Learning area
JavaScript
JavaScript is in almost every website. Here you learn the basics – with examples to try, tasks and automatic checks, just like with Python. If you already know Python, you'll recognise a lot.
Chapter 1Beginner
- 0125 minutes
Hello, JavaScript!
Print something with console.log() · Create variables with let and const · Build text with template strings
- 0225 minutes
Decisions with if
Branch with if, else if and else · Compare values with === · Combine conditions with && and ||
- 0330 minutes
Loops
Count with for · Repeat with while as long as something holds · Add up results in a loop
- 0430 minutes
Arrays – many values at once
Create arrays and read values by index · Add values with push and go through them with for…of · Process arrays with filter and map
- 0530 minutes
Functions
Write functions with function · Return values with return · Use arrow functions (=>)
- 0630 minutes
Objects
Create objects with properties · Read and change properties · Work with arrays of objects
- 0735 minutes
Project: guess the number
Ask for input with prompt() · Turn text into numbers with Number() · Build a complete game with while, if and counters
Chapter 2Web pages
- 0835 minutes
Your own web page: HTML and CSS
Write a web page with a heading, paragraphs and lists in HTML · Set colours, spacing and font sizes with CSS · Style several elements the same way with classes
- 0940 minutes
Web pages with JavaScript: DOM and clicks
Find an element on the page with document.querySelector · Change the text and look of an element with JavaScript · React to clicks with addEventListener
- 1035 minutes
Drawing with canvas
Paint rectangles and circles on a drawing area (canvas) · Draw patterns with loops · Change a drawing with a click
- 1145 minutes
Project: click hunt in the browser
Put an element at a random place with JavaScript · Make a clock count down with setInterval · Combine HTML, CSS and JavaScript into a finished game