Line At A Time
Intro to JavaScript

Intro to JavaScript

const & let, template literals, arrays and arrow functions. 25 bite-size lessons.

0 / 25 lessons complete
Start Lesson 1 Open the JavaScript sandbox ↗
1
Hello, World!
Make the computer say hello, every programmer's first program.
2
Variables with const
Store a value in a variable and print it.
3
Changing Values with let
Use let for values that change.
4
Doing Maths
Try all four maths operators.
5
Joining Strings
Glue two pieces of text together with +.
6
Template Literals
Drop variables straight into text, the modern way.
7
Booleans
Create a true/false value.
8
If Statements
Only run code when a condition is true.
9
Else
Do one thing when true, another when false.
10
Triple Equals
Compare values the JavaScript way: ===.
11
Else If
Check several conditions, one after another.
12
The OR Operator
Combine conditions with ||.
13
The AND Operator
Combine conditions with &&.
14
Arrays
Store several values in one variable.
15
Indexes and length
Pick single items out of an array.
16
Growing Arrays
Add to an array with push.
17
for...of Loops
Visit every item in an array, one by one.
18
Counting Loops
Loop a set number of times with a counter.
19
Adding It Up
Total up all the numbers in an array.
20
While Loops
Count down to lift-off with while.
21
Break
Escape from a loop with break.
22
Continue
Skip one trip around a loop with continue.
23
Functions
Write your own function and call it twice.
24
Inputs and Return
Give a function inputs and get an answer back.
25
Roll a Six
Grand finale: keep rolling a dice until you get a 6.