JavaScript Tutorial
JavaScript makes web pages interactive. These concise lessons each come with a live editor and a console, so you run real code and see the output as you learn. The DOM lesson at the end connects it all back to HTML.
1IntroductionWhat JavaScript is and your first lines of code.
2VariablesStore values with let and const.
3Data TypesStrings, numbers, booleans and more, with a live example.
4OperatorsDo maths and compare values with operators.
5If...ElseMake decisions with if, else if and else.
6LoopsRepeat actions with for and while loops.
7FunctionsReuse code with functions, parameters and return.
8ArraysStore lists of values and loop over them.
9ObjectsGroup related data with objects and properties.
10and the DOMChange a web page with JavaScript: select elements and respond to clicks.