Skip to content

Instantly share code, notes, and snippets.

@L2L2L
Created September 7, 2014 01:15
Show Gist options
  • Save L2L2L/5928f56007770c58249e to your computer and use it in GitHub Desktop.
Save L2L2L/5928f56007770c58249e to your computer and use it in GitHub Desktop.
this... and "use strict";
"use strict"; //<= comment out strict mode after running it to see the output.
function self(){
console.log(this);
}
console.log("with gOPN this:" + Object.getOwnPropertyNames(this)); // => []
console.log("just cl this:" + this); // => {}
console.log("with gOPN this.__proto__:" + Object.getOwnPropertyNames(this.__proto__));
console.log("just cl this.__proto__:" + this.__proto__);
process.stdout.write("function self: ");
self();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment