Test name | Executions per second |
---|---|
Math.sqrt | 504.3 Ops/sec |
sqrt with Math.pow | 507.1 Ops/sec |
sqrt with astrisk ** | 83952.6 Ops/sec |
var numbers = Array.from(Array(10000), (_,x) => (Math.random()*x));
numbers.forEach(x => Math.sqrt(x));
numbers.forEach(x => Math.pow(x,0.5));
numbers.forEach(x => x**0.5);