Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
!!emptyStr 36131640.0 Ops/sec
!!str 33557052.0 Ops/sec
!!null 35916212.0 Ops/sec
!!undefined 36453216.0 Ops/sec
!!0 35948856.0 Ops/sec
!!num 36228792.0 Ops/sec
Boolean(emptyStr) 12654229.0 Ops/sec
Boolean(str) 12626233.0 Ops/sec
Boolean(null) 12595537.0 Ops/sec
Boolean(undefined) 12490717.0 Ops/sec
Boolean(0) 12533720.0 Ops/sec
Boolean(num) 12003357.0 Ops/sec
Script Preparation code:
Tests:
  • !!emptyStr

  • !!str

  • !!null

  • !!undefined

  • !!0

  • !!num

  • Boolean(emptyStr)

  • Boolean(str)

  • Boolean(null)

  • Boolean(undefined)

  • Boolean(0)

  • Boolean(num)


;