"this" vs reference

Benchmark created by Ryan on


Setup

var a = {
      count: 0,
      incrThis: function () {
        this.count ++;
      },
      incrA: function () {
        a.count ++;
      }
    };

Test runner

Ready to run.

Testing in
TestOps/sec
this
a.incrThis();
ready
reference
a.incrA();
ready

Revisions

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