I'm used to a javascript object constructors looking like this
function person(first, last) {
this.firstName = first;
this.lastName = last;
}
var dude = new person("the", "dude");
But sometimes I see the constructor return "this", like so
function person(first, last) {
this.firstName = first;
this.lastName = last;
return this;
}
What's up with returning this
at the end?