Math.hypot

hypot — Returns the square root of the sum of the squares of the arguments.

Description

Math.hypot(number value, [number values, …])

Parameters

Name Description Type Default Optional
value number No
values, … number Yes

Examples

Example #1 – hypot example
console.log(Math.hypot(42)); // 42 console.log(Math.hypot(3, 4)); // 5 console.log(Math.hypot(8, 11)); // 13.601470508735444 console.log(Math.hypot(-3, '4')); // 5

External references