Boolean constructor vs double negotiation trick in javascript

4 years ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
Test name Executions per second
Boolean 961709.6 Ops/sec
Double negation trick 2658207.0 Ops/sec
Script Preparation code:
Tests:
  • Boolean

  • Double negation trick

Open this result on MeasureThat.net