arguments-woes (v4)

Revision 4 of this benchmark created by Kit Sunde on


Preparation HTML

<script>
  function f() {
    return (typeof arguments[0] === 'undefined') ? 0 : 1;
  }
  
  function fg(x) {
    return (typeof arguments[0] === 'undefined') ? 0 : 1;
  }
  
  function g(x) {
    return (typeof x === 'undefined') ? 0 : 1;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
missing argument check via arguments
f(); f(1);
ready
missing argument check via named arg
g(); g(1);
ready
missing argument check
fg(); fg(1);
ready

Revisions

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