Languages / JavaScript Core
Values and Types
Primitives, objects, coercion, equality, and the quirks that follow.
Data types in JavaScript
ECMAScript divides values into seven primitives and Object. typeof is the everyday type check, but it has well-known holes. This overview maps the type system and points to chapters on copying, coercion, numbers, strings, and symbols.
Pass by value and reference in JavaScript
Primitives are copied by value; objects are shared by copying a reference to the same identity. Reassigning a binding is not the same as mutating an object. This chapter explains what actually moves when you pass arguments or assign to another variable.
Type coercion and equality in JavaScript
Operators and built-ins convert operands when types do not match. Loose equality runs a long conversion pipeline; strict equality compares type and value without coercion. This chapter maps the rules that explain surprising console output.
Numbers and BigInt in JavaScript
JavaScript numbers are IEEE-754 double-precision values with a safe integer range and familiar binary rounding surprises. BigInt stores arbitrary integers but cannot mix with number in arithmetic without an explicit conversion. This chapter covers literals, safety checks, and when to use each type.
Strings and template literals in JavaScript
JavaScript strings are immutable sequences of UTF-16 code units, not full Unicode code points. Template literals add interpolation, multiline text, and tagged functions. This chapter covers creation, indexing, iteration, and common Unicode pitfalls.
Symbols in JavaScript
A symbol is a unique, immutable primitive used as a property key that will not collide with string keys or other libraries. Well-known symbols customize built-in behavior. This chapter covers creation, registry symbols, and where symbols show up in everyday APIs.
JavaScript Fails
JavaScript will look you in the eye and insist that these results are normal. NaN is a number, 0.1 + 0.2 is not 0.3, and two empty arrays added together become a string. This page keeps each famous expression, the value it produces, and the rule that makes the despair official.