BigInt — exact integers
BigInt(value) creates a bigint primitive for exact integer arithmetic beyond the safe Number range. Learn how conversion works, which arithmetic restrictions apply, and how to produce text with toString(radix).
CKTIS / JavaScript
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
BigInt(value) creates a bigint primitive for exact integer arithmetic beyond the safe Number range. Learn how conversion works, which arithmetic restrictions apply, and how to produce text with toString(radix).
Boolean(value) converts a value to primitive true or false using JavaScript's truthiness rules. It does not interpret the string "false" as false. Calling it with new creates an object rather than a primitive boolean.
decodeURI decodes percent escapes in URI text while preserving encoded delimiters such as %2F. Learn how it differs from decodeURIComponent and how malformed input is handled.
decodeURIComponent decodes percent escapes in an individual URI component, interpreting encoded bytes as UTF-8. It returns text, leaves + unchanged, and throws URIError for malformed encoding.
encodeURI() encodes characters in a complete URI while leaving some delimiters unchanged. It returns a new string using UTF-8 percent-encoding; it is not intended for encoding individual parameter values.
encodeURIComponent encodes one URI component, such as a query parameter value. It converts special characters and non-ASCII characters into percent escapes representing UTF-8 bytes.
The global isFinite(value) function checks whether its argument becomes a finite Number after conversion. Unlike Number.isFinite(), it also accepts some non-number values through conversion, including "42" and null.
The global isNaN(value) function first converts its argument to Number, then checks whether the result is NaN. Unlike Number.isNaN(), it can return true for strings or undefined, so it is not a general test for a valid number.
parseFloat converts its argument to text and reads the longest valid prefix in decimal numeric notation. It ignores leading whitespace and trailing text; when no number can be read, it returns NaN.
parseInt reads a leading integer representation in a specified radix and returns a Number. It ignores subsequent invalid characters, so it does not validate the entire input string.
String(value) converts a value to a primitive string. Calling it without an argument returns an empty string. If conversion succeeds, new String(value) creates a wrapper object rather than a primitive value.
Symbol() creates a unique, immutable primitive value that can serve as an object property key. A description does not determine a symbol's identity; Symbol.for() instead allows a symbol to be shared through a registry.
async marks an asynchronous function: calling it returns a Promise, and its body can use await. It does not automatically run code in parallel or on a separate thread.
The break statement exits the nearest enclosing loop or switch. Its labelled form exits a specified enclosing statement, including a labelled block.
The case keyword marks an execution entry point within a switch statement. Matching uses strict equality, and without break or another interruption, execution continues into subsequent clauses.
The catch keyword introduces a handler for an exception thrown while a try block executes. Its optional parameter exposes the thrown value. After the exception is handled, execution can continue after the try...catch statement.
The class keyword defines a class built on JavaScript prototypes. Learn the role of constructor, the distinction between instance fields and methods, and the rules for creating objects with new.
The const keyword declares a block-scoped name that cannot be assigned another value after initialization. It does not make an object or array accessed through that name immutable.
The continue statement skips the remaining part of the current loop iteration and proceeds to the loop's next step. Unlike break, it does not end the loop. An optional label can select an enclosing loop.
The debugger; statement marks a place where an active debugger may pause program execution. Without a debugger present or active, it has no observable effect.
The `default` keyword identifies a fallback clause in `switch` or a module's default export. It does not assign default parameter values and cannot be used as a variable name.
The do keyword starts a do...while loop. Its body executes before the first condition check, so the body is entered at least once, even when the condition is false from the outset.
The `else` keyword introduces the branch executed when the associated `if` condition converts to `false`. It is optional and cannot appear on its own.
The export keyword exposes elements of an ECMAScript module to other modules. It supports named exports, one default export, and re-exporting from another module.