Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

hypot javascript

/* The Math.hypot() function in JavaScript is used to calculate the square root
of the sum of squares of numbers passed to it as arguments. */

//Try it:
console.log(Math.hypot(5, 12));
// expected output: 13

console.log(Math.hypot(3, 4, 5));
// expected output: 7.0710678118654755

console.log(Math.hypot(-5));
// expected output: 5
 
PREVIOUS NEXT
Tagged: #hypot #javascript
ADD COMMENT
Topic
Name
9+4 =