Binary data and streams
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.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
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.
A stack processes elements in LIFO order, a queue uses FIFO, and an LRU cache evicts the least recently used entry. JavaScript implementations can use Array and Map, but must deliberately handle ordering, operation costs and missing values.
Comments describe code intent without executing their contents. Learn // and /* ... */ syntax, the /** ... */ documentation convention, and how line terminators can affect program parsing.
Conditions let you choose which code runs based on an expression's Boolean interpretation. Learn if, else if, and else, truthy/falsy conversion, and the distinction between a conditional statement and the ?: operator.
Assigning an object does not create a copy. A shallow copy creates a new outer object but shares nested objects. A deep copy also recreates nested objects within the supported structure.
A data processing pipeline connects reading, validation, filtering, transformation, and writing stages. When exchanging JSON, graph references and correctly escaped paths need separate attention.
Debounce postpones execution until a burst of calls becomes quiet, while throttle limits execution frequency during a burst. Distinguish leading and trailing variants: they determine whether the first call, the last call, or both are retained.
The DOM represents a document as a tree of objects that JavaScript can read and modify. DOM manipulation includes creating, attaching, updating, and removing nodes. It is an interface supplied by the browser environment, not ECMAScript language syntax.
Error handling lets you respond to exceptions without mixing them with a function's normal result. Learn throw, try, catch, and finally, and distinguish synchronous exceptions from Promise rejections.
The event loop coordinates script execution and event handling in a browser. Distinguishing tasks, microtasks, and rendering opportunities helps you predict the order of asynchronous code.
Events let code respond to user actions and changes in page state. Learn capture, target and bubbling, distinguish canceling default behavior from stopping propagation, and understand lifecycle, visibility, scrolling, resizing and input events.
Expressions compute values, while operators specify operations on operands. Learn precedence, assignment, comparisons, type conversion, and short-circuit evaluation.
filter selects elements that satisfy a condition, while map transforms their values. By default, chaining them creates a new array without directly changing the input array.
A finite-state machine describes behavior through states and input-dependent transitions. The CSV parsing state machine example shows how explicit state distinguishes a field separator from a comma inside quotes and helps detect invalid input.
Use `input` to react to edits and `submit` to handle a form submission after normal validation succeeds. `HTMLFormElement` also provides methods for explicitly checking form validity.
Functional programming builds computations from small functions while limiting mutation and side effects. JavaScript supports this style through functions passed as values and methods such as filter, map, and reduce, but does not enforce function purity.
A function groups code for repeated calls. Learn the difference between parameters and arguments, how return values work, and how hoisting lets you call a declared function before its position in the source.
Graphics and media are applications of JavaScript for processing images, audio, and video. Distinguish computations performed by ECMAScript from host facilities that display or play the resulting data.
Internationalization prepares a program for different languages and regional conventions. In JavaScript, Intl provides locale-sensitive operations, but it does not automatically translate application content.
Input supplies data to a program, and output sends results outside it. Learn the difference between environment-provided I/O and converting JavaScript values to JSON text and back.
An iterator exposes successive results through next(), while an iterable supplies an iterator through Symbol.iterator. A generator makes both mechanisms easier to implement using function* and yield.
Linear search checks array elements in order until it finds a match or reaches the end. It needs no sorting; the demonstrated function returns the index of the first match or -1.
Loops repeat statements according to a condition or successive elements. Learn how for, while, do...while, for...of, and for...in differ, and how break and continue control execution.