closure missing semicolon in return statements

JavaScript performance comparison

Test case created

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
closure's original code
function square(a){return a*a}for(var c=0;100>c;)"number"===typeof c&&(square(c),c+=1);
pending…
closure's code with semicolon inserted
function square(a){return a*a;}for(var c=0;100>c;)"number"===typeof c&&(square(c),c+=1);
pending…
Original code
// see http://jsperf.com/asi-versus-msi

function square(number) {
  var result = number * number;
  return result;
};

var c = 0;

while (c < 100) {
  if (typeof c === 'number') {
    square(c);
    c += 1;
  };
};
pending…

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

Compare results of other browsers

0 comments

Add a comment