Standard built-ins

Math.hypot()

Try the free JavaScript compiler

Computes Euclidean norm from components using Number conversion. An infinite magnitude yields Infinity even if another argument is NaN. No arguments yields +0.

Formal Syntax & Structure

javascript syntaxjavascript
Math.hypot(...values)

Parameters & Attributes

NameTypeDescription
valuesnumber[]Individual numeric arguments (coerced to Number).

Return Value

number

Calculated Number.

Working Example

Example Snippetjavascript
console.log(Math.hypot(3,4));
JavaScript Reference