JavaScript runs in every web browser, which is why it's one of the most useful first languages.
Direct answer
To learn JavaScript from scratch: write tiny programs using variables, decisions, loops, functions, lists (arrays) and objects, then use JavaScript to change a web page. Practise every day in short sessions and build small projects. The basics take a few weeks; comfort takes a few months.
A first program
const name = "Sam";
let score = 3;
if (score > 2) {
console.log(name + " is winning");
}
const and let store values, if makes a decision and console.log shows output.
Learning order
- Values and variables
- Decisions with
if - Loops
- Functions
- Arrays (lists)
- Objects
- The DOM: changing web pages. See JavaScript DOM tutorial
- Events and forms
- Fetching data
A 30-day outline
| Week | Focus |
|---|---|
| 1 | Variables, decisions, loops |
| 2 | Functions and arrays |
| 3 | Objects and small projects |
| 4 | The DOM and events |
Practise
- A tip calculator
- A quiz
- A to-do list
- A number guessing game
Tips
- Type code yourself.
- Use the browser console.
- Read error messages.
- Build before you binge tutorials.
Related
Python vs JavaScript for beginners and TypeScript for beginners.
Where Teyro fits
Teyro's JavaScript for Beginners course teaches JavaScript from zero on your phone: variables, decisions, functions, lists and objects, with real code that runs in every ten-minute lesson. Continue with Interactive Web Pages with JavaScript. Both are free to start.
The bottom line
Short, daily practice and small projects.


