Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Chrome 87
Windows
Desktop
4 years ago
Test name Executions per second
this 19745.6 Ops/sec
that 18563.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();