Skip to content
Codyssey

Learning Mode

Learn JavaScript one step at a time

A structured curriculum with short lessons, hands-on practice and challenges that check your code by actually running it.

chapters
5
lessons
25
interactive activities
70
challenges
15

How lessons work

Short lessons with practice built in

  1. See the goals

    Every lesson opens with its learning objectives and an estimated time.

  2. Read and see examples

    Short explanations, one idea per paragraph, with code examples and their output.

  3. Answer the activities

    Activities appear inside the lesson. Hints are available, and an explanation appears after a correct answer or after two misses.

  4. Finish and earn XP

    A lesson is complete when every activity is answered correctly. Reopening a lesson gives no extra XP.

JavaScript curriculum

Every chapter and lesson

Open a chapter to see its lessons and challenges.

Chapter 1JavaScript BasicsMeet JavaScript, write your first code, and store data in variables.5 lessons · 3 challenges · Adventure island: Starter Island

Lessons

  1. What Is JavaScript?The programming language behind the web, servers, and apps.3 min10 XP2 activities
  2. Your First JavaScript CodeWrite your first statements and print results with console.log.4 min10 XP2 activities
  3. Understanding Console OutputPrint several values at once and read the output line by line.4 min10 XP2 activities
  4. CommentsWrite notes in your code that JavaScript ignores.3 min10 XP2 activities
  5. Variables with let and constStore values under a name so you can reuse and change them.5 min15 XP3 activities

Challenges

  • Harbor GreetingRead the notice board code and predict what appears in the console.Predict the outputEasy20 XP
  • Village SuppliesUse let and const to keep track of the village supplies.Write codeMedium30 XP
  • The Lantern MysteryFind out what happens when a const is reassigned.Multiple choiceEasy20 XP

Chapter bonus: 50 XP

See Starter Island
Chapter 2Data TypesMeet strings, numbers, booleans, null, and undefined, then convert values from one type to another.5 lessons · 3 challenges · Adventure island: Data Island

Lessons

  1. StringsStore text, join pieces of text together, and measure its length.5 min10 XP3 activities
  2. NumbersWhole numbers and decimals, doing math, and the special value NaN.4 min10 XP3 activities
  3. BooleansTrue or false values, the results of comparisons, and the typeof operator.4 min10 XP3 activities
  4. Null and UndefinedTwo ways JavaScript says "there is no value".4 min10 XP3 activities
  5. Type ConversionTurn values into strings, numbers, or booleans, and spot automatic conversion.6 min15 XP3 activities

Challenges

  • Crystal SortingUse typeof to find out what kind of value each crystal holds.Predict the outputEasy20 XP
  • The Crystal LedgerRecord a crystal’s details using the right data types.Write codeMedium30 XP
  • The Broken ConverterFix a calculation that joins text instead of adding numbers.Write codeHard40 XP

Chapter bonus: 50 XP

See Data Island
Chapter 3Operators and LogicCalculate values, compare them, combine conditions, and make decisions with if and else.5 lessons · 3 challenges · Adventure island: Logic Forest

Lessons

  1. Arithmetic OperatorsAdd, subtract, multiply, divide, and find remainders with JavaScript.5 min10 XP3 activities
  2. Comparison OperatorsCompare two values and get a true or false answer.4 min10 XP3 activities
  3. Logical OperatorsCombine several conditions with &&, ||, and !.5 min10 XP3 activities
  4. If and ElseLet your program choose a path based on a condition.6 min10 XP3 activities
  5. Conditional ExpressionsPick one of two values in a single line with the ternary operator.5 min15 XP3 activities

Challenges

  • The First CrossroadsRead the signpost code and predict which path it picks.Predict the outputEasy20 XP
  • The Root GateComplete the condition that opens the giant root gate.Fill in the codeMedium30 XP
  • The Forest GuideWork out the travel time and decide on a plan to leave the forest.Write codeHard40 XP

Chapter bonus: 50 XP

See Logic Forest
Chapter 4LoopsRepeat code with for and while, then control the flow with break and continue.5 lessons · 3 challenges · Adventure island: Loop Lagoon

Lessons

  1. Why Loops MatterRepeat the same work without copying code again and again.3 min10 XP2 activities
  2. For LoopsRepeat code a set number of times with a counter.5 min10 XP3 activities
  3. While LoopsRepeat code as long as a condition stays true.5 min10 XP3 activities
  4. Break and ContinueStop a loop early or skip a single iteration.4 min10 XP3 activities
  5. Loop ChallengesCombine loops with if to count things and build text.6 min15 XP3 activities

Challenges

  • The Lighthouse BellComplete a for loop so the bell rings exactly five times.Fill in the codeEasy20 XP
  • Full NetsUse a loop to count the total fish and the full nets.Write codeMedium30 XP
  • The Tide LogTrace a while loop that uses continue and break.Predict the outputHard40 XP

Chapter bonus: 50 XP

See Loop Lagoon
Chapter 5FunctionsWrap code in functions you can call again and again, give them input, and get results back.5 lessons · 3 challenges · Adventure island: Function Castle

Lessons

  1. Introduction to FunctionsGive a block of code a name and run it whenever you need it.4 min10 XP3 activities
  2. Parameters and ArgumentsPass values into a function so it can do something different on each call.5 min10 XP3 activities
  3. Return ValuesSend a result from inside a function back to the code that called it.5 min10 XP3 activities
  4. Arrow FunctionsWrite functions in a shorter way with =>.5 min10 XP3 activities
  5. Function ChallengesCombine functions with if statements and loops to solve real tasks.6 min15 XP3 activities

Challenges

  • The Gatekeeper’s GreetingCreate a function named greet that returns "Hello".Write codeEasy20 XP
  • The Castle Toll BridgeTrace functions that call each other and predict the bridge keeper’s messages.Predict the outputMedium30 XP
  • The Great Gate CodeWrite a function gateCode(n) that adds up every number from 1 to n.Write codeHard40 XP

Chapter bonus: 50 XP

See Function Castle

Interactive activities

Four kinds of activity

Lessons and challenges use the same activity types. The examples below come from challenges in the app.

Multiple choice

Choose the correct answer. Some options are text, others are code.

What happens when this code runs?

const lanterns = 4;
lanterns = 5;
console.log(lanterns);
  • It prints 5
  • It prints 4
  • A TypeError is thrown
  • It prints undefined

From the challenge "The Lantern Mystery"

Predict the output

Read the code and write every line it prints to the console.

Write every line that is printed.

const port = "Starter Harbor";
console.log("Welcome to", port);
console.log("Ships:", 3);

From the challenge "Harbor Greeting"

Fill in the code

Fill in the missing parts of the code, by typing or by tapping a suggestion.

The gate opens when keys is at least 2 and it is not night. Complete the code.

const keys = 2;
const isNight = false;

if (keys ___ 2 ___ !isNight) {
  console.log("The gate opens");
} ___ {
  console.log("The gate stays shut");
}

Choices

  • >=
  • >
  • &&
  • ||
  • else
  • else if

From the challenge "The Root Gate"

Write code

Write your own code. It runs in a sandbox and is checked with behavioural tests.

Create a function named greet that returns the text "Hello".

// Write your function here

Tests that run

  • greet is a function
  • greet() returns "Hello"

From the challenge "The Gatekeeper’s Greeting"

Coding challenges

Challenges that check real code

Each chapter has three challenges of rising difficulty. Write-code challenges are never checked by searching for text: your code runs, and its results are compared with the expected values.

Each challenge suggests lessons to read first, but nothing is locked.

Before the Functions chapter, write-code challenges can only check the final values of variables.

XP per challenge by difficulty

  • Easy20 XP
  • Medium30 XP
  • Hard40 XP
  • 1× Multiple choice
  • 5× Predict the output
  • 2× Fill in the code
  • 7× Write code

XP and progress

One progress record for everything

Lessons give 10 XP (15 XP for the last lesson in each chapter), challenges give 20 to 40 XP, and completing a chapter gives a 50 XP bonus. The whole course is worth 955 XP.

You level up at 100, 250, 450, 700 and 1,000 XP.

The same progress appears on Home, in Learning Mode, in Adventure Mode and on your Profile. All of it is stored on the device.

Achievements

  • First StepComplete your first lesson.
  • JavaScript ExplorerComplete five lessons.
  • Challenge AcceptedComplete your first challenge.
  • Island ExplorerComplete every lesson and challenge on one island.
  • Rising CoderEarn 300 XP.
  • Goal GetterReach your daily learning goal.

Preview

What a lesson looks like

This preview uses content from the lesson "Variables with let and const". The layout is redrawn for this website.

Conceptual preview, not an app screenshot

Step 2 of 415 XP

Variables with let and const

Named containers

A variable stores a value under a name. Use let for values that will change, and const for values that must not be reassigned.

let score = 0;
score = 10;

const playerName = "Ana";
console.log(playerName, score);
Output shown in the lesson
Ana 10

Prefer to learn while you explore?

The same chapters are waiting for you as islands in Adventure Mode.