Lesson guide
Learning objectives
- Explain the main purpose of Manuals and specifications in JavaScript.
- Identify the syntax, APIs, or concepts introduced in this lesson.
- Use the examples to predict how JavaScript will behave before you run similar code.
- Connect this topic to nearby lessons in An introduction.
Real-world context
This lesson matters when you need to recognize where Manuals and specifications fits into real JavaScript programs. This book is a tutorial.
Key ideas
- Manuals and specifications is part of the An introduction chapter, so it builds on the surrounding concepts rather than standing alone.
- Read each code example in two passes: first for the result, then for the rule that explains the result.
- When a section compares similar features, focus on the condition that makes you choose one feature over another.
Key terms
- Manuals and specifications
- Manuals
- specifications
- An introduction
- JavaScript
This book is a tutorial. It aims to help you gradually learn the language. But once you’re familiar with the basics, you’ll need other resources.
Specification
The ECMA-262 specification contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
But being that formalized, it’s difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it’s not for everyday use.
A new specification version is released every year. Between these releases, the latest specification draft is at https://tc39.es/ecma262/.
To read about new bleeding-edge features, including those that are “almost standard” (so-called “stage 3”), see proposals at https://github.com/tc39/proposals.
Also, if you’re developing for the browser, then there are other specifications covered in the second part of the tutorial.
Manuals
- MDN (Mozilla) JavaScript Reference is the main manual with examples and other information. It’s great to get in-depth information about individual language functions, methods etc.
You can find it at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference.
Although, it’s often best to use an internet search instead. Just use “MDN [term]” in the query, e.g. https://google.com/search?q=MDN+parseInt to search for the parseInt function.
Compatibility tables
JavaScript is a developing language, new features get added regularly.
To see their support among browser-based and other engines, see:
- https://caniuse.com – per-feature tables of support, e.g. to see which engines support modern cryptography functions: https://caniuse.com/#feat=cryptography.
- https://kangax.github.io/compat-table – a table with language features and engines that support those or don’t support.
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.
Common mistakes
- Skipping the small examples and then missing the exact rule that Manuals and specifications depends on.
- Copying code without changing one value at a time to see which part controls the result.
- Treating similar-looking syntax or APIs as interchangeable before checking their edge cases.
Active code check
Predict
Predict the two boolean values before running. Which one is the real numeric NaN?
Reveal explanation
A reference page is useful for details like this: Number.isNaN checks the number value NaN, not the string that happens to contain the same letters.
Try it
Replace "NaN" with 0 / 0 and check again. Use the result to decide when the specification treats a value as numeric NaN.
Summary
- Manuals and specifications gives you one more piece of the JavaScript mental model.
- The examples in this lesson are the quickest way to check whether the rule is clear.
- Revisit the key terms when you meet the same idea in later chapters.
Practice
- Rewrite one example from this lesson without looking at the original, then run it and compare the result.
- Change one input, operator, method call, or option in a code sample and predict what will happen before running it.
- Explain Manuals and specifications in your own words as if you were reviewing it with another learner.
Keep learning
Continue with Code editors when you are ready for the next lesson.