function expression or declaration

JavaScript performance comparison

Revision 5 of this test case created by

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
function expression w/o closure
var test = function() {
    var a = function() {
          return "do something";
        };
    return a
};

test();
pending…
function declaration w/o closure
var test = function() {
    function a() {
      return "do something";
    };
    return a
};

test();
pending…
function expression w/ closure
var a = function() {
    return "do something";
};
var test = function() {
    return a
};

test();
pending…
function declaration w/ closure
function a() {
  return "do something";
};
var test = function() {
    return a
};

test();
pending…
named function declaration w/o closure
var test = function() {
    var a = function a() {
        return "do something";
    };
    return a
};

test();
pending…
named function declaration w/ closure
var a = function a() {
    return "do something";
};
var test = function() {
    return a
};

test();
pending…

Compare results of other browsers

Revisions

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

0 Comments