Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Knowledge base — JavaScript

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 1003

JavaScript

extends — class inheritance

The `extends` keyword creates a derived class. When given a base constructor, it links the class to it through prototype chains. This lets the class inherit and override methods, and `super` lets it call the base constructor or inherited methods.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

finally — the concluding block of a try statement

The finally keyword introduces a block executed after try and any catch, before control continues elsewhere. It supports cleanup even during a return or exception, but can itself override the earlier outcome.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

for — loop with initialization, condition, and update

The for keyword creates a loop. Its classic form combines initialization, a condition checked before each iteration, and an update performed after the loop body.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

function — declarations and expressions

The function keyword defines a function with parameters and a body. Learn the difference between a declaration and a function expression, and how return supplies a result.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

get — property getter

The get syntax defines a getter: a function invoked when a property is read. It lets you compute a value without calling a method with parentheses; get itself is not a reserved word.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

if — conditional statement

The if statement selects a code branch based on a condition. An optional else handles a false result, while else if checks further conditions in a defined order.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

import — importing JavaScript modules

The import keyword makes exports from other modules available. Learn static declarations, live bindings, and how import(...), import.meta, and ordinary function calls differ.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

let — block-scoped variable declaration

let declares a block-scoped variable that can be reassigned. Learn initialization, shadowing, and the temporal dead zone, plus the differences from var and const.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

new — invoking a constructor

The new operator invokes a constructor with supplied arguments and returns an object. For an ordinary constructor function, it creates an object linked to the function's prototype and exposes that object inside the function as this.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

of — contextual keyword in loops

`of` separates the loop variable from the source of values in `for...of`. It is a contextual keyword, not a reserved word: outside that role, it can be used as a variable name.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

return — exit a function and return a value

The return statement ends function execution and can send a result back to the caller. Learn about an empty return, early exits, and the newline pitfall.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

set — defining a property setter

`set` defines a setter: a function invoked when a property is assigned. It is part of accessor syntax, not a word reserved in every context.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

static — static class elements

`static` defines fields, methods, and accessors belonging to the class itself rather than its instances. A `static { ... }` block performs initialization when the class is created, without calling `new`.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

super — base constructor and inherited method access

The super keyword calls a base constructor or accesses properties through the prototype of the object where a method was defined. A super.method() call preserves the current this value.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

switch — selecting a branch

The switch statement selects where execution begins by strictly comparing a value with case expressions. Learn how default, break, fall-through, and the shared declaration scope affect control flow.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

this — a value determined by the calling context

The `this` keyword reads the current `this` binding. In an ordinary function its value depends on how the function is called, while an arrow function uses the enclosing binding. Storing a function in an object does not permanently bind it to that object.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

throw — throwing an exception

The throw statement raises an exception and interrupts normal execution. A catch clause can receive the thrown value; no line break is allowed between throw and its expression.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

try — exception handling

The try statement defines a block whose exceptions can be handled by catch. An optional finally runs finalization code even during return or exception propagation. A catch, finally, or both is required.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

var — variable declaration

The `var` keyword declares a variable whose scope is not limited by an ordinary block. A new binding usually starts with `undefined`, but a separate binding in a function body can instead start with the value of a same-named parameter. A declaration without an initializer leaves an existing binding’s value unchanged. An initializer assigns a value only when execution reaches the declaration.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

while — a loop that tests before running

The while statement repeats its body while its condition converts to true. It checks the condition before every iteration, so the body might never run.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

with — legacy name-lookup statement

The with statement temporarily includes an object in name lookup. It is forbidden in strict mode; use explicit property access in new code.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

yield — suspending a generator

The `yield` expression suspends a generator and exposes a value to its consumer. A subsequent `next(value)` resumes execution and supplies a value to the suspended expression; `yield*` delegates iteration.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Number — converting values to numbers

Number(value) converts a value to a primitive number. Learn the difference between conversion and a new Number(value) wrapper object, and how Number.prototype.toString converts a number to text.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Addition assignment (+=)

The += operator performs numeric addition or string concatenation, then attempts to write the result to the assignment target, which it evaluates only once. If the write does not throw, the expression yields the computed result even if the write is ignored.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support