Test name | Executions per second |
---|---|
Boolean | 795005312.0 Ops/sec |
Boolejan | 783902144.0 Ops/sec |
Boolejan 2 | 449934560.0 Ops/sec |
var bFalse = false;
var sEmpty = '';
var sFilled = 'Foo';
var nZero = 0;
var nOne = 1;
var Boolejan = (input) => !!input
var Boolejan2 = (input) => !input ? false : true
Boolean(bFalse)
Boolean(sEmpty)
Boolean(sFilled)
Boolean(nZero)
Boolean(nOne)
Boolejan(bFalse)
Boolejan(sEmpty)
Boolejan(sFilled)
Boolejan(nZero)
Boolejan(nOne)
Boolejan2(bFalse)
Boolejan2(sEmpty)
Boolejan2(sFilled)
Boolejan2(nZero)
Boolejan2(nOne)