function versus variable execution

Benchmark created on


Description

Testing timing of function declaration versus variable assignment.

Test runner

Ready to run.

Testing in
TestOps/sec
Function Declaration
function doThis() {
    return 1 + 1;
}

for (var i = 0; i < 10; i++) {
    doThis();
}
ready
Variable Declaration
var doThis = function() {
    return 1 + 1;
}

for (var i = 0; i < 10; i++) {
    doThis();
}
ready

Revisions

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