TypeError — an invalid-operation error
TypeError is a built-in JavaScript error type, often indicating an operation incompatible with a value's type. You can catch it or explicitly throw it when validating function arguments.
CKTIS / JavaScript
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
TypeError is a built-in JavaScript error type, often indicating an operation incompatible with a value's type. You can catch it or explicitly throw it when validating function arguments.
Uint16Array is a typed buffer view storing integers from 0 to 65535, using 2 bytes per element. Learn how values are converted and how copying data differs from sharing a view.
Uint32Array is a typed buffer view: each element occupies 4 bytes and stores a number from 0 to 4294967295. Learn value conversion, view construction, and the difference between sharing memory and copying.
Uint8Array exposes buffer data as unsigned 8-bit integers ranging from 0 to 255. It lets you create bytes, copy them, or share memory through views; out-of-range writes wrap rather than clamp.
Uint8ClampedArray is a typed array storing integers from 0 to 255. Writes clamp values to that range and round fractions, rather than wrapping values as Uint8Array does.
URIError is a built-in JavaScript error type indicating malformed data during URI encoding or decoding. Learn its typical causes, how to construct it, and how to handle it selectively.
WeakMap associates values with keys without keeping the keys themselves alive. Learn set, get, has, and delete, identity-based key comparison, and the limitations around iteration and garbage collection.
WeakSet holds unique objects and non-registered symbols without keeping them alive solely through membership. It provides add, has, and delete, but does not let you iterate over its elements or read their count.
Array is the built-in constructor for arrays: ordered, zero-indexed collections of values. Learn array creation, the length property, and the difference between an empty slot and an element whose value is undefined.
Date stores a timestamp. Learn how to read and change the UTC year, understand object mutation, and handle date normalization, including moving February 29 into a non-leap year.
JSON is JavaScript’s built-in object for reading and writing JSON text. JSON.parse creates values from text, while JSON.stringify serializes values, but does not preserve every JavaScript type or object structure.
Map stores unique keys of any type together with their associated values. It supports reading and deleting entries, checking whether a key exists, and iterating in insertion order.
Math is a built-in ECMAScript object providing mathematical constants and functions for Number values. Use its methods without creating an instance, and distinguish rounding down, rounding up, rounding to the nearest integer, and truncation.
Object is a built-in JavaScript function for creating objects and converting values to objects. It also exposes static methods for working with properties and prototypes. Distinguish an object's own properties from inherited properties.
Promise represents an eventual result or failure reason. Learn how its executor runs synchronously, how resolve and reject control the outcome, and how then and catch handle that outcome asynchronously.
Reflect provides static methods for reading, writing, and inspecting objects. A Boolean write result lets you check whether an operation succeeded, but does not mean the method can never throw.
RegExp describes patterns for searching text. Learn flags, groups, character classes, quantifiers and exec() result fields, including named captures, index ranges and stateful lastIndex behavior.
Set stores each distinct value only once and supports iteration in insertion order. Use it to remove duplicates and test membership without manually searching an array.
An accessible interaction combines keyboard operation, predictable focus, and state that assistive technology can understand. JavaScript should synchronize visibility with ARIA and communicate updates without moving focus unnecessarily.
Program architecture defines responsibilities, data flow, and dependency direction. In JavaScript, domain logic can be separated from use-case orchestration and environment interactions without requiring a particular framework.
An array-like object exposes a length and indexed properties, but need not be an array or an iterable. Learn what length means and how Array.from() creates an array from this structure.
Asynchronous operations can remain in progress together and finish in a different order from their start order. A generation token protects shared state from an older operation's result, but does not cancel its work.
ArrayBuffer stores bytes, while typed arrays and DataView interpret them. Learn about shared memory, byte order, and the distinction between an in-memory buffer and a stream.
A closure is a function together with access to the lexical environment where it was created. It lets the function use outer variables even after the function that created them has returned. It retains access to bindings, not a copy of their initial values.