JavaScript type system
JavaScript is dynamically typed: types belong to values, and a variable declared with let can hold values of different types over time. Learn the eight language types, conversions, and the limitations of the typeof operator.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
JavaScript is dynamically typed: types belong to values, and a variable declared with let can hold values of different types over time. Learn the eight language types, conversions, and the limitations of the typeof operator.
A variable binds a name to a value. Learn how declarations and initialization work, how let, const, and var differ, and how scope and initialization determine when values are accessible.
Web Components are web-platform mechanisms for building custom interface elements. Learn how to register a class extending HTMLElement, respond to connection and disconnection, and observe attributes. These are browser APIs, not features supplied by ECMAScript itself.
Pass `controller.signal` to an operation that supports cancellation, call `controller.abort()` to request it, and read `signal.aborted` to inspect the signal rather than the operation's outcome.
Set the FFT window size and spectrum smoothing, then size separate byte arrays for frequency bins and time-domain samples.
Report validation errors, hide decorative content from assistive technology, and move keyboard focus without adding an extra stop to the Tab sequence.
ARIA live regions expose content updates to assistive technology without moving focus. Choose the priority of an announcement and how much context it should include.
The same square brackets select array elements and access object properties by keys computed at runtime.
Take values from an iterable in order, skip positions, provide defaults, and collect the remaining values in a new array.
An array binding pattern initializes variables from values in iteration order. It can skip values, supply defaults, and collect the remaining values into a new array.
Unpack values from one iterable argument directly in a function signature, and distinguish an element default from a default for the entire parameter.
Use an array pattern to unpack one iterable argument in a function’s parameter list. Defaults for the argument and for individual values are separate.
Use square brackets to read and write zero-based array elements. Whether a key is an array index affects `length`, and a missing element is not the same as a stored `undefined`.
An array’s `length` defines its index span, not how many elements are present. Writing a new index can extend the array, while shortening it can delete elements.
An array’s `length` sets its index boundary; it does not count elements. Learn how indexed writes change that boundary and how to tell a hole from `undefined`.
Read `arr.length` to get an array’s length, or assign to it to truncate the same array or extend it without creating elements.
Arrow functions use `=>`. The parameter list determines whether parentheses are required, and the body form determines whether a value is returned implicitly. The surrounding scope supplies `this`.
An arrow function has no `this` binding of its own. It uses the binding from its enclosing lexical context, regardless of how the arrow is called.
Route an audio or video element through an analyser to the audio output, and manage graph processing separately from the element’s playback.
Use `new Blob()` to combine text and binary parts into an immutable sequence of bytes. Options set the MIME label and control how text line endings are handled.
Use `blob.size` to get the total byte count without reading the contents, and `blob.stream()` to process those bytes in chunks.
Separate clearing pixels from resetting the path. Build a circle with `arc()`, choose a paint with `fillStyle`, and render its interior with `fill()`.
Distinguish Canvas 2D drawing operations from direct bitmap reads and writes, and know when each coordinate system applies.
`fillStyle` controls what fills a shape, `strokeStyle` controls what paints its outline, and `lineWidth` sets the outline's thickness. Each is a separate Canvas 2D drawing-state property.