Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/52.0.2743.116 Chrome/52.0.2743.116 Safari/537.36
Chromium 52
Ubuntu
Other
8 years ago
Test name Executions per second
this 23441.8 Ops/sec
that 22799.9 Ops/sec
Script Preparation code:
x
 
function Monster()
{
    this.x = 100;
    this.y = 100;
    console.log("Monster created at " + this.x + " / " + this.y + "!");
}
function Monster2()
{
    var that = this;
    that.x = 100;
    that.y = 100;
    console.log("Monster created at " + that.x + " / " + that.y + "!");
}
Tests:
  • this

     
    new Monster();
  • that

     
    new Monster2();