Robust way to declare functions with function names

Benchmark created by Devin Rhode on


Test runner

Ready to run.

Testing in
TestOps/sec
From kangax
var someFn = (function() {
  return function someFn() {
    return Math.random(); //actually has to execute some stuff
  }
})();
ready
plain jane
var someFn = function() {
  return Math.random(); //actually has to execute some stuff
};
ready
function declaration
function someFn() {
  return Math.random(); //actually has to execute some stuff
}
ready

Revisions

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

  • Revision 1: published by Devin Rhode on