Has anyone noticed this behavior before? This really threw me off... I would have expected prototyped arrays to be private to each class instance rather than shared between
The behaviour is correct. [] is tranlated to new Array() in runtime, but only one such array is ever created.
[]
new Array()
In other words, Obj.prototype = {...} is executed just like any other assigment.
Obj.prototype = {...}