Boolean constructor vs double negotiation trick in javascript

one year ago
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Test name Executions per second
Boolean 680349696.0 Ops/sec
Double negation trick 559285312.0 Ops/sec
Script Preparation code:
Tests:
  • Boolean

  • Double negation trick

Open this result on MeasureThat.net