Tests:
  • !!true

  • Boolean(true)

  • !!{a: 1, b: 2}

  • Boolean({a: 1, b: 2})

  • !!{}

  • Boolean({})

  • !![1, 2, 3]

  • Boolean([1, 2, 3])

  • !![]

  • Boolean([])

  • !!`string`

  • Boolean(`string`)

  • !!``

  • Boolean(``)

  • !!NaN

  • Boolean(NaN)

  • !!undefined

  • Boolean(undefined)

  • !!null

  • Boolean(null)

  • Boolean(false)

  • !!false

  • Boolean(0)

  • !!0

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    !!true
    Boolean(true)
    !!{a: 1, b: 2}
    Boolean({a: 1, b: 2})
    !!{}
    Boolean({})
    !![1, 2, 3]
    Boolean([1, 2, 3])
    !![]
    Boolean([])
    !!`string`
    Boolean(`string`)
    !!``
    Boolean(``)
    !!NaN
    Boolean(NaN)
    !!undefined
    Boolean(undefined)
    !!null
    Boolean(null)
    Boolean(false)
    !!false
    Boolean(0)
    !!0

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
!!true 1013915904.0 Ops/sec
!!false 1006821312.0 Ops/sec
Boolean(false) 17906792.0 Ops/sec
Boolean(null) 17874290.0 Ops/sec
!!null 1013008448.0 Ops/sec
Boolean(undefined) 9005074.0 Ops/sec
!!undefined 17875368.0 Ops/sec
Boolean(NaN) 8718277.0 Ops/sec
!!NaN 17311276.0 Ops/sec
Boolean(``) 17842834.0 Ops/sec
!!`` 1009398400.0 Ops/sec
Boolean(`string`) 17870876.0 Ops/sec
!!`string` 1010698560.0 Ops/sec
Boolean([]) 17736690.0 Ops/sec
!![] 1010128832.0 Ops/sec
Boolean([1, 2, 3]) 17736486.0 Ops/sec
!![1, 2, 3] 1004623040.0 Ops/sec
Boolean({}) 17753682.0 Ops/sec
!!{} 1006861056.0 Ops/sec
Boolean({a: 1, b: 2}) 17730594.0 Ops/sec
!!{a: 1, b: 2} 1006344128.0 Ops/sec
Boolean(true) 17731028.0 Ops/sec
Boolean(0) 17840570.0 Ops/sec
!!0 1007621952.0 Ops/sec


;