var x = Math.sqrt(num);
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 number = 16
Math.sqrt(number);
//output = 4
console.log(Math.sqrt(4)); // 2
console.log(Math.sqrt(9)); // 3
console.log(Math.sqrt(2)); // 1.4142135623730951
console.log(Math.sqrt(0)); // 0
console.log(Math.sqrt(-0)); // -0
console.log(Math.sqrt(-1)); // NaN
// Math.sqrt()
// The Math.sqrt() function returns the square root of a number.
// EXAMPLE : 1
let square_root_of = Math.sqrt(4);
console.log(square_root_of);
// OUTPUT: 2
// EXAMPLE : 2
let square_root_of_1 = Math.sqrt(-9);
console.log(square_root_of_1);
// OUTPUT: NaN (NOT A NUMBER)
// EXAMPLE : 3
let square_root_of_3 = Math.sqrt(8);
console.log(square_root_of_3);
// OUTPUT: 2.8284271247461903
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));