Skip to content

takahirox/js-arguments-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

js-arguments-test

This is a micro benchmark test for comparing the performance and memory allocation among the following four JavaScript function arguments styles.

function normalOp(a, b) {
  return other(a, b);
}

function leakyArguments() {
  return other.apply(this, arguments);
}

const spreadOp = (...args) => {
  return other.apply(this, args);
};

function indexedArguments() {
  return other(arguments[0], arguments[1]);
}

We added an arguments.length check test.

function argLength(a, b) {
  if (arguments.length < 3) {
    return other(a, b);
  }
  return 0;
}

Online Demo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages