Cómo cuadrar un valor en JavaScript
// Use Math.pow(a,b); where a is your value and b is the exponent
var num = Math.pow(4, 2);
//num returns 16
Ill Impala
// Use Math.pow(a,b); where a is your value and b is the exponent
var num = Math.pow(4, 2);
//num returns 16
console.log(Math.sqrt(4)); // 2
console.log(Math.sqrt(16)); // 4
console.log(Math.sqrt(64)); // 8
console.log(Math.sqrt(100)); // 10
let sqrt = (c, depth = 100, x = 1) =>
depth <= 0 ? x :
sqrt(c, depth - 1, x - (Math.pow(x, 2) - c)/(2*x))
console.log(sqrt(2));