Closed coderofsalvation closed 8 years ago
Relying on the constructor
property is something that should be avoided whenever possible. Using an indirect Array()
and Object()
to construct []
and {}
are also unclear and inefficient. Also, using for..in
on an array is a bad idea because it will enumerate all properties on the prototype, which isn't the semantic one often wants.
I was just wondering why this extend() does more then for example this one: https://gist.github.com/coderofsalvation/8239d9362744896f766c
why the isArray stuff? Is it for browser compatibility reasons?