Tests:
  • ==

  • ===

  • == str

  • === str

  • == true

  • == null

  • === null

  • === true

  • == str with str

  • === str with str

  • == str with number

  • === str with number

  • obj to bool

  • bool to bool

  • arr to bool

  • str to bool

  • null to bool

  • null == undefined

  • undefined == null

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    ==
    ===
    == str
    === str
    == true
    == null
    === null
    === true
    == str with str
    === str with str
    == str with number
    === str with number
    obj to bool
    bool to bool
    arr to bool
    str to bool
    null to bool
    null == undefined
    undefined == null

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Chrome 87 on Windows
View result in a separate tab
Test name Executions per second
== 3692.1 Ops/sec
null to bool 3696.0 Ops/sec
str to bool 31.6 Ops/sec
arr to bool 5.0 Ops/sec
bool to bool 3658.8 Ops/sec
obj to bool 10.2 Ops/sec
=== str with number 3695.1 Ops/sec
== str with number 34.1 Ops/sec
null == undefined 5.9 Ops/sec
=== str with str 3697.0 Ops/sec
=== true 3681.8 Ops/sec
=== null 3673.7 Ops/sec
== null 3677.1 Ops/sec
== true 3685.6 Ops/sec
=== str 3675.9 Ops/sec
== str 135.8 Ops/sec
=== 3678.2 Ops/sec
== str with str 3670.9 Ops/sec
undefined == null 1837.5 Ops/sec