Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Windows
Desktop
21 days ago
Test name Executions per second
let number = +'100' 104677912.0 Ops/sec
let number = parseInt('100') 8546226.0 Ops/sec
let str = "" + 100 102924360.0 Ops/sec
let str = String(100) 8193978.5 Ops/sec
let number = Number("100") 8638681.0 Ops/sec
let bool = !!1 107816104.0 Ops/sec
let bool = Boolean(1) 8542353.0 Ops/sec
let str = new String(100) 8712519.0 Ops/sec
let number = 100 105781600.0 Ops/sec
let number = new Number("100") 7142400.0 Ops/sec
Tests:
  • let number = +'100'

  • let number = parseInt('100')

  • let str = "" + 100

  • let str = String(100)

  • let number = Number("100")

  • let bool = !!1

  • let bool = Boolean(1)

  • let str = new String(100)

  • let number = 100

  • let number = new Number("100")


;