JavaScript Scope Chain

JavaScript performance comparison

Test case created by Kyle Florence

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
Private variables
(function(window) {
 var local = 0;

 window.obj = {
  test: function() {
   return local;
  }
 };
})(window);

obj.test();
pending…
Using 'this'
(function(window) {
 window.obj = {
  local: 0,
  test: function() {
   return this.local;
  }
 };
})(window);

obj.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