Boolean() と Logical NOT Operator の速度比較

Benchmark created by think49 on


Preparation HTML

<script>
  var _Boolean = Boolean;
  
  function boolean(arg) {
   return _Boolean(arg);
  }
  
  function logicalNotOperator(arg) {
   return !!arg;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Boolean()
boolean(1);
ready
Logical NOT Operator
logicalNotOperator(1);
ready

Revisions

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