JavaScript Fundamentals: Learn the Language of the Web

JavaScript Fundamentals is a beginner-level course of 6 lessons (about 3 h 50 min), with 18 exercises and 18 quiz questions. Prerequisites: Programming Basics and Algorithms. Exercises run in the browser, with nothing to install.

  • Front-end
  • Beginner
  • 6 lessons
  • 3 h 50 min
  • 18 exercises
  • Exercises run in the browser

The course in brief

This course teaches the fundamentals of the JavaScript language in its modern version (ES2024 and beyond), independent of the browser. You will work with variables, conditions, loops, functions, arrays, and objects, and learn to handle errors and organize your code into modules. Exercises are checked by automated tests, and the final project is to write the calculation engine for a shopping cart.

What you will be able to do

  • Declare variables and handle primitive types without conversion pitfalls
  • Write conditions and loops, and use ?? and ?. appropriately
  • Design pure, reusable, testable functions
  • Transform collections with map, filter, reduce, and toSorted
  • Model data as objects and exchange JSON
  • Handle errors and split your code into ES modules

Syllabus: 6 lessons

    • Declare variables with const and let
    • Recognize primitive types and use typeof
    • Build strings with template literals and compare with ===

    Variables (const, let)JavaScript primitive typesOperators and comparisons

  1. 02

    Conditions and Loops

    20 min
    • Make decisions with if/else, the ternary operator, and switch
    • Understand truthy/falsy values and the ?? and ?. operators
    • Repeat instructions with for, for...of, and while

    ConditionsLoopsTruthy and falsy values

  2. 03

    Functions

    20 min
    • Declare regular and arrow functions
    • Use default parameters, rest parameters, and return values
    • Understand variable scope and functions passed as arguments

    FunctionsScope and closuresCallback functions

  3. 04

    Arrays and Their Methods

    20 min
    • Create, read, and modify arrays
    • Transform data with map, filter, reduce, find, some, and every
    • Sort and copy without modifying the original (toSorted, spread)

    ArraysArray methods (map, filter, reduce)Copying and immutability

  4. 05

    Objects and JSON

    20 min
    • Create and manipulate objects (properties, methods, dynamic access)
    • Destructure, copy, and merge objects
    • Iterate over an object and convert data to JSON

    ObjectsDestructuring and spreadJSON

  5. 06

    Handling Errors and Organizing Code into Modules

    15 min
    • Throw and catch errors with throw, try/catch/finally
    • Validate input data in functions
    • Split a program into ES modules (import/export)

    Error handlingES modules

Final project

Shopping Cart Calculation Engine

Write, as a JavaScript module with no interface, the complete logic of a cart: adding and removing items, changing quantities, computing the subtotal, tiered shipping costs, VAT, and a promo code, then exporting the cart as JSON and reloading it from JSON. All functions are pure and validate their inputs.

Deliverables

  • A panier.js file exporting at least 6 functions (ajouter, retirer, changerQuantite, sousTotal, total, exporter/importer)
  • A test file using node:assert covering normal cases and error cases
  • A short README describing the cart's JSON format

Assessment criteria

  • Amounts calculated in whole cents, with no rounding errors
  • No function modifies the cart it receives (copies with spread, map, filter)
  • Invalid inputs rejected with explicit errors (RangeError, TypeError)
  • Import of invalid JSON handled cleanly with try/catch
  • Relevant use of map, filter, reduce, destructuring, and ??
  • Code split into short functions with explicit names, exported as ES modules

Frequently asked questions

Do I need to know HTML and CSS to follow this JavaScript course?

No: this course is about the language itself and its exercises run without a web page. You only need the basics of programming (variables, conditions, loops), covered in the algorithms course. HTML and CSS will be needed for the DOM and Events course.

Does this course teach modern JavaScript?

Yes: const and let, arrow functions, destructuring, spread, ?? and ?., toSorted (ES2023), Object.groupBy (ES2024), and ES modules. Older practices like var are flagged as things to avoid.

How are the exercises graded?

Each code exercise is checked by automated tests run with Node.js. You immediately see which tests pass, and hints are offered if you get stuck.

What comes after JavaScript Fundamentals?

The DOM and Events course applies these concepts in the browser, then the Asynchronous JavaScript course covers promises, fetch, and APIs.

This course, told for your job

Say what you want to be able to do: “JavaScript Fundamentals” takes its place in your path, with examples from your field. The concepts stay those of the course.

The preview is free, and you can take the courses one at a time without paying. The path only contains lessons from the catalogue.