Standard built-ins
Math.hypot()
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
| Name | Type | Description |
|---|---|---|
| values | number[] | Individual numeric arguments (coerced to Number). |
Return Value
number
Calculated Number.
Working Example
Example Snippetjavascript
console.log(Math.hypot(3,4));