let vs var

JavaScript performance comparison

Revision 45 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
var
(function() {

  'use strict';
  var k = 3;
  while (--k) {
    var i = 5;
    while (--i) {
      var v1 = i + 'foo bar baz';
      var v2 = i;
    }
  }
})();
pending…
let
(function() {

  'use strict';
  var k = 3;
  while (--k) {
    let i = 5;
    while (--i) {
      let v1 = i + 'foo bar baz';
      let v2 = i;
    }
  }
})();
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