Every guide lists its sources, tips, and warnings. Read our editorial policy.

How to Learn JavaScript

JavaScript clicks when you learn the basics in order and then build small projects that make each concept stick. This illustrated guide covers 2 methods and 16 steps, with a separate picture for every step.

Download checklist (PDF)

JavaScript clicks when you learn the basics in order and then build small projects that make each concept stick.

This guide walks through the process in clear illustrated steps, from the first preparation to a finished result. Each step has its own picture, so you can compare your progress as you go.

How to use this guide

Work through the steps in order. Method 1 of 2 covers the basics, and the later methods offer alternatives and finishing touches. If you only have a minute, skim the Quick steps box above and come back for the details.

Trusted external resources

A note on sources

We check each guide against the official resources listed in References at the end of this article. External links open in a new tab; the related guides above stay on this site.

Quick steps

  1. Set up a browser and editor
  2. Learn variables, types, and functions
  3. practise with small daily exercises
  4. Build a project to apply what you know

Things you'll need

  • A computer
  • A modern browser
  • A code editor
  • An internet connection for tutorials

Step-by-step

Section 1

Method 1 of 2: Build a Strong Foundation

Step 1: Set up your tools

Install a code editor and open your browser's developer console.

Step 1: Set up your tools

Step 2: Learn what JavaScript does

Understand that it adds behaviour and interaction to web pages.

Step 2: Learn what JavaScript does

Step 3: Write your first line

Print a message to the console to confirm everything runs.

Step 3: Write your first line

Step 4: Learn variables

Store values with let and const so you can reuse them.

Step 4: Learn variables

Step 5: Understand data types

Recognise strings, numbers, booleans, arrays, and objects.

Step 5: Understand data types

Step 6: Write a function

Bundle a reusable block of code behind a clear name.

Step 6: Write a function

Step 7: Use conditionals

Run different code with if and else statements.

Step 7: Use conditionals

Step 8: Practise loops

Repeat tasks with for and while loops.

Step 8: Practise loops
Section 2

Method 2 of 2: Practise and Apply

Step 9: Follow a structured course

Work through a beginner curriculum in order rather than at random.

Step 9: Follow a structured course

Step 10: Solve small exercises

Practise daily challenges to make syntax second nature.

Step 10: Solve small exercises

Step 11: Build a mini project

Create something small like a to-do list or a quiz.

Step 11: Build a mini project

Step 12: Break problems down

Split a big task into small steps you can code one at a time.

Step 12: Break problems down

Step 13: Learn to debug

Read errors and use console logs to find what went wrong.

Step 13: Learn to debug

Step 14: Read other people's code

Study simple open-source scripts to see new patterns.

Step 14: Read other people's code

Step 15: Learn the DOM

Manipulate page elements so your code changes what users see.

Step 15: Learn the DOM

Step 16: Keep a project portfolio

Save your finished projects to show what you can build.

Step 16: Keep a project portfolio

Tips

  • Code a little every day rather than cramming once a week.
  • Type examples out yourself instead of only reading them.

Warnings

  • Do not jump into frameworks before the basics feel comfortable.
  • Copying code without understanding it slows real progress.

Frequently asked questions

How long does it take to learn javascript?
What supplies do I need for learn javascript?
Is learn javascript safe for beginners?

References

  1. MDN — JavaScript fundamentals. https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting
  2. freeCodeCamp — JavaScript curriculum. https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/
  3. wikiHow — How to Learn JavaScript. https://www.wikihow.com/Learn-JavaScript

Every guide is reviewed against its sources. See our editorial policy.

Reader comments

0 so far

Finished this guide? Tell other readers what worked, what didn't, and what you would change.

Be kind and constructive. Comments are published instantly.