Linked Questions

Popular Questions

I'm a little confused about the function below, specifically the use of this(). I want to know to what this() refers to.

Array.prototype.Swap = function (x,y) {  
  var b = this[x];  
  this[x] = this[y];  
  this[y] = b;  
  return this; // return the current array instance.  
} 

Is it pointing to the function itself, or to x or y? I checked the other topics that talked about this() and i see that I talks about empty function and it’s not illustrates the prototype on it

Related Questions