Boolean fn vs explicit negation operator

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Boolean fn
var one = false;
var two = '';
var three = 'Foo';
var four = 0;
var five = 1;
Boolean(one);
Boolean(two);
Boolean(three);
Boolean(four);
Boolean(five);
ready
Single negation operator
var one = false;
var two = '';
var three = 'Foo';
var four = 0;
var five = 1;
!one;
!two;
!three;
!four;
!five;
ready
Double negation operator
var one = false;
var two = '';
var three = 'Foo';
var four = 0;
var five = 1;
!!one;
!!two;
!!three;
!!four;
!!five;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.