What is it?
JavaScript is the language that runs in the browser (and a lot of servers, runtimes, and tools). It's loosely typed, single-threaded, and event-driven. The fundamentals — values, types, functions, scope, control flow — are tiny. The depth comes from how the language behaves at the edges, not from how much there is to memorize.
Why it matters
JS is the language every frontend job interview will probe. Frameworks come and go; closures, scope, and equality semantics don't. Solid fundamentals turn React into a thin wrapper you understand instead of magic you copy from Stack Overflow.
What to learn
- Primitives vs objects: string, number, boolean, null, undefined, symbol
- Equality:
==vs===, and why===is the default - Functions: declarations, expressions, arrow functions
- Scope: block, function, lexical — and what closures actually are
- Control flow:
if, ternary,switch,for,while,for...of - Truthy / falsy values and the gotchas of
0,"",null,undefined
Common pitfall
Using == and being surprised when [] == false is true. The loose
operator runs through a 9-step coercion table no one remembers. Use
=== everywhere unless you have a specific reason — most senior code
never uses ==.
Resources
Primary (free):
- MDN — JavaScript first steps · docs
- JavaScript.info · docs
- The Modern JavaScript Tutorial — Ilya Kantor · docs
Secondary (paid):
- Eloquent JavaScript (book) · article
Practice
Pick five JavaScript "wat" examples — [] + [], typeof null,
0.1 + 0.2. For each one, predict the output before running it, then
explain why it produces what it does in one sentence. Done when you can
talk through five edge cases without a console.
Outcomes
- Read JavaScript code and predict its output without running it.
- Pick the right primitive type for any given value.
- Explain closures with a real example, not just the dictionary definition.
- Write a function that uses block scope, lexical scope, and a closure correctly.