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

Math.log: natural logarithm

Math.log converts its argument to Number and returns an approximation of the natural logarithm with base e.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.log10: base-10 logarithm

Math.log10 converts its argument to Number and returns an approximation of the base-10 logarithm.

Intermediate · ECMAScript 2015 onward; example target: Node.js 24.22.2
JavaScript

Math.log2 — base-2 logarithm

Math.log2(x) calculates the base-2 logarithm: the exponent to which 2 must be raised to obtain x. Learn about argument conversion, special results, and precision limits.

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

Math.max: largest value

Math.max converts every argument to Number and returns the largest resulting value.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.min: smallest value

Math.min converts every argument to Number and returns the smallest resulting value.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.PI: the number pi

Math.PI is the closest Number representation of π, the ratio of a circle’s circumference to its diameter.

Basic · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.pow — raising numbers to a power

Math.pow(base, exponent) raises a base to a specified power and returns a Number. Learn how argument conversion works, how negative and fractional exponents behave, and when the result is NaN.

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

Math.random() — generating a random number

Math.random() returns a Number in [0, 1), with an approximately uniform distribution. It suits simple random choices, but provides neither cryptographic security nor a reproducible seed.

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

Math.round: nearest integer

Math.round converts its argument to Number and returns the nearest integral Number, breaking ties toward +Infinity.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.sign: numeric sign

Math.sign converts its argument to Number and returns -1, +1, the corresponding zero, or NaN according to its sign.

Basic · ECMAScript 2015 onward; example target: Node.js 24.22.2
JavaScript

Math.sin: sine in radians

Math.sin converts its argument to Number and returns an approximation of its sine, interpreting the angle in radians.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.sqrt: square root

Math.sqrt converts its argument to Number and returns its non-negative square root, or NaN for a negative value.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.tan: tangent in radians

Math.tan converts its argument to Number and returns an approximation of its tangent, interpreting the angle in radians.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Math.trunc: the integer part toward zero

Math.trunc converts its argument to Number and removes its fractional part, rounding toward zero.

Intermediate · ECMAScript 2015 onward; example target: Node.js 24.22.2
JavaScript

Number.EPSILON: spacing between numbers near 1

Number.EPSILON is the difference between 1 and the smallest representable Number greater than 1, equal to 2^-52.

Intermediate · ECMAScript 2015 onward; example target: Node.js 24.22.2
JavaScript

Number.MAX_SAFE_INTEGER: upper safe-integer boundary

Number.MAX_SAFE_INTEGER has the exact value 2^53−1, or 9007199254740991, and marks the positive boundary of Number’s safe integer range.

Intermediate · ECMAScript 2015 onward; example target: Node.js 24.22.2
JavaScript

Number.MIN_SAFE_INTEGER: lower safe-integer boundary

Number.MIN_SAFE_INTEGER has the exact value −(2^53−1), or -9007199254740991, and marks the negative boundary of Number’s safe integer range.

Intermediate · ECMAScript 2015 onward; example target: Node.js 24.22.2
JavaScript

Number.NaN: the Number “not-a-number” value

Number.NaN is the special Number value for an invalid or indeterminate numeric result and is the same value as global NaN.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Number.NEGATIVE_INFINITY: negative infinity

Number.NEGATIVE_INFINITY is the Number value -Infinity, smaller than every finite number and identical to global -Infinity.

Intermediate · ECMAScript 1 onward; example target: Node.js 24.22.2
JavaScript

Number.parseFloat: parsing a decimal prefix

Number.parseFloat converts its argument to text, skips leading white space, and returns the number from the longest valid decimal prefix or NaN.

Intermediate · ECMAScript 2015 onward; example target: Node.js 24.22.2