Skip to content

Instantly share code, notes, and snippets.

@eshacker
Created February 1, 2016 06:15
Show Gist options
  • Save eshacker/4d9685d244721de3bda8 to your computer and use it in GitHub Desktop.
Save eshacker/4d9685d244721de3bda8 to your computer and use it in GitHub Desktop.
A very short study in this of JavaScript
function Namer(){
console.log(this instanceof Namer);
}
Namer(); // false
new Namer(); // true
Namer.call(Namer.prototype); // false
Namer.call(new Namer); // true true
Namer.call(Namer); // false
Namer.call(Object.create(Namer.prototype)); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment