Script Preparation code:
AخA
 
const thenumber = -90
Tests:
  • Math.abs

     
    if (Math.abs(thenumber) === 90) { console.log(thenumber) }
  • Two equals, negative first

     
    if (thenumber === -90 || thenumber === 90) { console.log(thenumber) }
  • Two equals, positive first

     
    if (thenumber === 90 || thenumber === -90) { console.log(thenumber) }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Math.abs
    Two equals, negative first
    Two equals, positive first

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 28 days ago)
Mozilla/5.0 (X11; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136 on Linux
View result in a separate tab
Test name Executions per second
Math.abs 293203.2 Ops/sec
Two equals, negative first 279960.8 Ops/sec
Two equals, positive first 278194.3 Ops/sec