Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Windows
Desktop
2 years ago
Test name Executions per second
Boolean 1139126.6 Ops/sec
Boolejan 1563434.0 Ops/sec
Boolejan 2 1623416.4 Ops/sec
Script Preparation code:
x
 
var bFalse = false;
var sEmpty = '';
var sFilled = 'Foo';
var nZero = 0;
var nOne = 1;
var Boolejan = (input) => !!input
var Boolejan2 = (input) => !input ? false : true
Tests:
  • Boolean

     
    Boolean(bFalse)
    Boolean(sEmpty)
    Boolean(sFilled)
    Boolean(nZero)
    Boolean(nOne)
  • Boolejan

     
    Boolejan(bFalse)
    Boolejan(sEmpty)
    Boolejan(sFilled)
    Boolejan(nZero)
    Boolejan(nOne)
  • Boolejan 2

     
    Boolejan2(bFalse)
    Boolejan2(sEmpty)
    Boolejan2(sFilled)
    Boolejan2(nZero)
    Boolejan2(nOne)