How to calculate square root in JavaScript

1 Answer

0 votes
const a = 9;
console.log(Math.sqrt(a));  
   
const b = 85;
console.log(Math.sqrt(b));
  
const c = 9;
console.log(Math.sqrt(c, 0.5));

  
  
/*
run:
      
3
9.219544457292887
3

*/

 



answered Feb 19, 2016 by avibootz
edited May 20, 2024 by avibootz
...