Let\'s say I have this code:
(function(global) {
function Bar(foo) {
this.foo = foo;
return this;
}
Bar.prototype.getFoo = funct
An aside :
With prototypal inheritance, there's a fundamentel difference between own properties and inherited ones.
Sometimes this can be quite relevant.
A classic for loop that is often used, only checks for the 'own properties', taking this form :
for (prop in array) {
if (array.hasOwnProperty(prop)) {
dostuff
}
When assigning to this, alle properties are own properties, making the hasOwnProperty check irrelevant.