tag:blogger.com,1999:blog-34454975.post44587960017855454..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: An In House, Yep Nope Like, JS LoaderAndrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-34454975.post-39035385295490130932013-03-31T15:44:02.754+02:002013-03-31T15:44:02.754+02:00when you say ...
var n = Object.create(null);
n.__...when you say ...<br />var n = Object.create(null);<br />n.__proto__ = {};<br /><br />for (var k in n) console.log(k); // __proto__ !!!<br />Object.keys(n); // ["__proto__"] !!!<br /><br />Got it? So, __proto__ is enumerable in some browser, is not in some other but it will be in all future browsers. Let's go on with examples ... <br /><br />Take this into account...<br />__proto__ is a reference, you are destroying it in an assigment like that.<br />prototype is a constructor.<br />At the moment of an equity declaration you are calling a constructor too, which by the way is used with "new" to replicate (inherit) another object, having the same constructor (prototype) they will have the same reference (pointer if you wish to call it that way) called __proto__<br />Since variables are created automatically in declarations and assigments, depending how you do it, or __proto__ becomes lost, or becomes trapped in a closure, en either case you can't recover it.Anonymoushttps://www.blogger.com/profile/10188803541972459522noreply@blogger.com