Feature detection: test the feature, not the version
Every current browser prints true four times. An old browser would print false for features it lacks, and your code could fall back to another way.
JavaScript is the programming language of the web: an engine inside your browser (or inside Node.js on a server) reads your code and runs it, and the language itself is defined by a yearly standard called ECMAScript.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
In the second example, add a line that prints whether fetch exists, labelled fetch:. What does it print here, and what would old Node.js (before version 18) print?
Write two lines that print the ECMAScript edition that introduced let/const and the one that introduced async/await, each as a sentence.
Explain it without notes
What is a JavaScript engine, and can you name three?
What is the difference between the JavaScript language and the browser it runs in?
What is ECMAScript, and how are its versions named?
Why does a single syntax error stop a whole script, while a runtime error only stops it partway?
Preview
Console
Nothing logged yet.Expected console output
Array at() (ES2022) true
Array toSorted() (ES2023) true
Object.groupBy (ES2024) true
structuredClone (browser API) true