Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121
Windows
Desktop
one year ago
Test name Executions per second
pow 1528646.8 Ops/sec
mult 1621803.6 Ops/sec
Tests:
  • pow

    AخA
     
    let array = [];
    for(let i = 0; i < 100; i++){
    array.push(Math.pow(i,2));
    }
    for(let i = 0; i < 100; i++){
    const decimal = i+.1;
    array.push(Math.pow(decimal,2));
    }
  • mult

     
    let array = [];
    for(let i = 0; i < 100; i++){
    array.push(i*i);
    }
    for(let i = 0; i < 100; i++){
    const decimal = i+.1;
    array.push(decimal*decimal);
    }