setting default variable value

Benchmark created by mikekim on


Preparation HTML

<script>
  function usingIf(optionalParam) {
   if (!optionalParam) {
    optionalParam = true;
   }
  }
  
  function notUsingIf(optionalParam) {
   optionalParam = optionalParam || true;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
using if
usingIf()
ready
not using if
notUsingIf()
ready

Revisions

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

  • Revision 1: published by mikekim on