Skip to content

Instantly share code, notes, and snippets.

@lacyrhoades
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lacyrhoades/d730a72bd63af35d4260 to your computer and use it in GitHub Desktop.
Save lacyrhoades/d730a72bd63af35d4260 to your computer and use it in GitHub Desktop.
What comes out for #1 - #9 ?
console.log('1');
console.log(this);
console.log();
function SomeObject(param) {
this.name = param;
console.log(this);
}
SomeObject.prototype.stuff = function () {
console.log('2');
console.log('Yeahhhhh...');
}
console.log('3')
var thing1 = SomeObject('one');
console.log();
console.log('4');
console.log(thing1);
console.log();
console.log('5');
var thing2 = new SomeObject('two');
console.log();
console.log('6');
console.log(thing2);
console.log();
console.log('7');
console.log(thing2.prototype);
console.log();
console.log('8');
console.log(SomeObject.prototype);
console.log();
console.log('9');
console.log(this);
console.log();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment