Test name | Executions per second |
---|---|
Boolean | 970111.1 Ops/sec |
Double negation trick | 2960512.8 Ops/sec |
var bFalse = false;
var sEmpty = '';
var sFilled = 'Foo';
var nZero = 0;
var nOne = 1;
Boolean(bFalse)
Boolean(sEmpty)
Boolean(sFilled)
Boolean(nZero)
Boolean(nOne)
!!bFalse
!!sEmpty
!!sFilled
!!nZero
!!nOne