Learn JavaScript
Start programming with JavaScript, the language of the web. Learn values, variables, conditionals, functions, scope, arrays, loops, iterator methods and objects, with small projects along the way.
- Beginner level
- 10 modules
- 87 lessons
- 349 tasks and questions
Syllabus
01IntroductionMeet JavaScript: print to the console, leave comments for other people, and work with JavaScript's basic data types, arithmetic, and the properties and methods built into strings, numbers and Math.9 lessons
02VariablesStore values under descriptive names with const and let, update numbers and strings, build messages with template literals, and check a value's type with typeof. Finish by planning the fuel budget for a road trip.8 lessons
03ConditionalsTeach your programs to make decisions with if, else and else if, compare values, combine conditions with logical operators, lean on truthy and falsy values, and pick between options with the ternary operator and switch.9 lessons
04FunctionsPackage code into reusable functions: declare and call them, pass in arguments, set default parameters, return results, combine helper functions, and write the same ideas as function expressions and arrow functions.9 lessons
05ScopeLearn where variables can be used: the global scope, block scope inside functions and if statements, why too many global variables cause bugs, and how to keep each variable in the smallest scope it needs.6 lessons
06ArraysStore lists of values in arrays: create them, read and update elements by index, add and remove items with push, pop, shift and unshift, search and copy with indexOf, includes and slice, and work with arrays inside functions and inside other arrays.9 lessons
07LoopsRepeat work without repeating code: count up and down with for loops, walk through arrays, nest loops inside loops, keep going until a condition changes with while and do...while, and control a loop with break and continue.9 lessons
08Higher-Order Functions and IteratorsTreat functions as values and pass them to other functions. Then use the built-in array iterator methods, forEach, map, filter, find, findIndex, reduce, some and every, to replace hand-written loops with clear one-liners.10 lessons
09ObjectsModel real things with objects: create object literals, read properties with dot and bracket notation, add, change and delete properties, store functions as methods, nest objects and arrays, understand references, and loop over properties with for...in.9 lessons
10Advanced ObjectsGo deeper with objects: refer to an object from its own methods with this, see why arrow functions behave differently, signal privacy, control access with getters and setters, build objects with factory functions, unpack them with destructuring, and use Object.keys, values, entries and assign.9 lessons