DEV Community

Cover image for Learn JavaScript Free
Khawaja Khurram (MAK)
Khawaja Khurram (MAK)

Posted on Originally published at makuistudio.com

Learn JavaScript Free

๐Ÿ“š This article was originally published on MAK Studio. Check out the full interactive lesson with live demos and code examples.


Home โ€บ
Courses โ€บ
JavaScript

๐ŸŸจ Learning Path ยท 2026

Learn JavaScript. Make pages do things.

JavaScript is the language of the browser โ€” the only thing that runs natively in every tab on every device. Learn it, and every page you build becomes interactive. This page is the map: what to learn, in what order, how long each phase takes, and the exact projects to build. Follow it in order and you'll be dangerous in 8 weeks.

~8 weeks, 1 hr/day
Beginner โ†’ Intermediate
ES2024 ยท browser

The Path
5 Concepts
Mistakes
Projects
FAQ

Learning JavaScript free in 2026 means three things: (1) start with the language before any framework, (2) build something visible after every phase โ€” the browser gives you instant feedback, use it, and (3) 1 hour a day for 8 weeks. Syntax takes 2 weeks. DOM and events take 2 more. The final 4 weeks are projects โ€” and that's where the language actually clicks.

Skip this page if: you already know another language and just need syntax. Read this page if: you're starting from zero and want to know exactly what comes next instead of guessing.

Why JavaScript

Every page on the web runs JavaScript. Every interactive form, every dropdown menu, every animation, every real-time chat โ€” all JavaScript. It's the only language that runs natively in browsers, which means the only one you can use to make a page actually respond to a user without a server round-trip. If you want to build things people can use, you need JavaScript.

It's also the language of every modern frontend framework. React, Vue, Svelte, Angular โ€” they all compile to JavaScript. Learning the framework without the language is exactly as hard as it sounds. People who learn JavaScript first pick up React in weeks; people who skip to React spend months confused.

The tradeoff: JavaScript has more moving parts than Python. The DOM, async, closures, and a history of weird decisions. But it gives you something Python can't โ€” immediate visual feedback. Change a line, save, refresh, see the result. That feedback loop accelerates learning faster than any tutorial.

The 8-week path

Follow these in order. Do not skip ahead โ€” each phase depends on the one before it.

1

Setup and first script

Week 1 ยท ~2 hours

No install. No Node. Just an HTML file and a browser. Write your first console.log(), open DevTools, and see the output. Then link a .js file to an HTML page. That's the entire setup โ€” free, instant, zero configuration.

DevToolsconsole.logscript tagComments

Your first script

2

Variables and types

Week 2 ยท ~4 hours

let, const, and why never to use var. Strings, numbers, booleans, arrays, objects. Template literals (backticks). Type coercion โ€” the weird thing JavaScript does that no other language does. Learn it now so it doesn't confuse you later.

let / constTemplate literalsArraysObjects

Variables and types

3

Functions

Week 3 ยท ~4 hours

Function declarations, expressions, and arrow functions. Why arrow functions don't have their own this. Default parameters. Closures โ€” the concept that separates intermediate developers from beginners. Learn them early; everything else in JS depends on them.

functionarrowScopeClosures

Functions and closures

4

The DOM

Week 4 ยท ~5 hours

The Document Object Model โ€” JavaScript's interface to the page. querySelector, createElement, textContent, classList. This phase is where JavaScript becomes visual. The first time you change text on a page with code, everything clicks.

querySelectorcreateElementclassList

DOM manipulation

5

Events

Week 5 ยท ~4 hours

Responding to clicks, keypresses, form submissions, and mouse movement. addEventListener, event objects, event delegation. Now your code responds to users. This is the phase that turns pages into apps.

addEventListenerevent.targetpreventDefault

Events and handlers

6

Async and fetch

Week 6 ยท ~4 hours

JavaScript's superpower and its biggest source of confusion. Callbacks, Promises, async/await, fetch. Once this clicks, you can build real apps that talk to APIs โ€” the exact skill every frontend job requires.

Promiseasync / awaitfetch

Async and fetch

7

Build a real project

Week 7 ยท ~6 hours

Pick one project from the list below. Build it. Break it. Rebuild it. This is the phase that separates people who learned JavaScript from people who can actually write JavaScript.

PlanBuildDebug

Project list

8

What comes next

Week 8+ ยท ongoing

After 8 weeks you have enough JavaScript to build anything the browser can do. The next step is a framework โ€” React or Vue โ€” plus tooling (npm, Vite). Those come after the language, never before.

ReactVueNode.js

Compare with Python

The 5 concepts that matter most

If you only truly understand five things in JavaScript, make it these.

1. Arrays and objects are everywhere

JavaScript data is almost always an array of objects. Master map, filter, and reduce โ€” those three methods cover 90% of data manipulation.

2. Functions are first-class values

You can store functions in variables, pass them as arguments, and return them from other functions. This is what makes callbacks, promises, and array methods possible. It's also what makes React work.

3. The DOM is how you touch the page

Every HTML element is a JavaScript object. querySelector gets one, textContent changes text, addEventListener reacts to users. This is what JavaScript means in 90% of job descriptions.

4. Async is how you don't block the page

Network requests take time. async/await lets you wait for results without freezing the interface. Every real app talks to a server โ€” this is the concept that separates toys from apps.

5. Use triple-equals for equality

Double-equals does type coercion (0 == "0" is true). Triple-equals doesn't (0 === "0" is false). The second one matches what you expect. Use it everywhere.

Common mistakes (from real beginners)

Each of these will cost you hours if you don't know it.

  1. Using == instead of ===

0 == "" is true. null == undefined is true. "5" == 5 is true. The == operator does type coercion and produces surprises. Use === (strict equality) everywhere.

  1. Using var instead of let/const

var has function-scope (not block-scope), hoists to the top of the function, and can be redeclared. It's a source of bugs that most modern code doesn't have. Use const by default, let when you reassign, never var.

  1. Modifying the array while looping over it

Same trap as Python. Pushing to an array inside a for-of loop over that array creates infinite loops. Use map, filter, or iterate over a copy with the spread operator.

  1. Forgetting to return in a map callback

[1,2,3].map(x => { x * 2 }) returns [undefined, undefined, undefined]. The curly braces make it a block, not an expression. Fix: .map(x => x * 2) or .map(x => { return x * 2; }). This one trips up everyone.

  1. Assuming this is the object

In a regular function, this depends on how the function is called. In an arrow function, this is inherited from the enclosing scope. Rule: in class methods, use regular functions. Everywhere else, prefer arrow functions.

  1. Async without await

const data = fetch("/api") gives you a Promise, not the data. Fix: const data = await fetch("/api"). But you can only use await inside an async function.

  1. Not checking for null

document.querySelector(".missing").addEventListener() throws "Cannot read property of null". The element might not exist. Fix: check first with an if statement, or use optional chaining (el?.addEventListener).

  1. Jumping to React too early

If you're in week 3, React will confuse you. Learn vanilla JavaScript for 2โ€“3 months first. Then React makes sense because you understand what it's abstracting.

Projects by difficulty

Build these in order. Each one uses only concepts from the phases before it.

Beginner

To-do list

Input field, add button, list of items with delete buttons. Uses phases 1-5. Save to localStorage for persistence.

Beginner

Calculator

Buttons, display, and math. Uses events and functions. First project that feels like a real tool.

Beginner

Quiz app

Array of questions, one at a time, track score. Uses arrays, objects, state management, events.

Intermediate

Weather app

Fetch data from a public API, display current weather. Uses async/await, fetch, DOM, error handling.

Intermediate

Tic-Tac-Toe

Game board, win detection, reset. Uses arrays, game state, event delegation. First project with real logic.

Advanced

Movie search app

Search box, debounced input, API results, cards. Uses async/await, debouncing, rendering lists, error states.

Frequently asked questions

How long does it take to learn JavaScript?

For basic syntax: 2-4 weeks at 1 hour a day. To build interactive pages independently: 2-3 months. To be job-ready for a junior frontend role: 6-12 months of consistent practice with real projects.

Do I need to install anything to learn JavaScript?

No. JavaScript runs natively in every browser. You can start with a text editor, an .html file, and a browser tab. Install Node.js only when you need to run JavaScript outside the browser.

What should I learn first in JavaScript?

Variables (let, const), data types, arrays, objects, functions, then DOM manipulation and events. Do not start with frameworks like React or Vue.

Is JavaScript harder than Python?

Yes and no. Similar syntax complexity, but harder ecosystem: the DOM, async, closures, and 1000 frameworks. But JavaScript gives immediate visual feedback in the browser.

Should I learn JavaScript before React?

Absolutely. React is built on JavaScript. Spend 2-3 months on vanilla JavaScript first. You'll learn React 5x faster.

What is the difference between let, const, and var?

const for values that don't change, let for values that do. var is the old way with weird scoping โ€” never use it in new code.

What projects should a beginner build in JavaScript?

A to-do list, a weather app, a calculator, a quiz app, and a simple game. Each teaches a specific concept. Build all five before touching a framework.

Why does JavaScript have so many frameworks?

Because it's been the only browser language for 25 years. React, Vue, Angular, Svelte are different answers to the same problem. As a beginner, ignore them all.

Continue your JavaScript path

[Lesson 1: Your first script

DevTools, console.log, and your first .js file](https://makuistudio.com/courses/javascript/lessons/intro.html)
[Python track

Compare with another language](https://makuistudio.com/courses/python/index.html)
[CSS snippets

UI components to pair with your JS](https://makuistudio.com/code/css/index.html)
[All courses

Back to the hub](https://makuistudio.com/courses/index.html)

External resources


๐Ÿš€ Want more free lessons?

This is part of a free 30+ lesson curriculum on HTML, Python, AI, and JavaScript. No sign-up. No ads. Just code.

๐Ÿ‘‰ Start learning for free

Top comments (0)