When creating a new object using Object.create() with a prototype object, it seems that the new object keeps a REFERENCE to the prototype for array properties.
Example Code
var obj = { color: ['white'], cat: 'Kitty', state: {}};
obj2 = Object.create(obj);
obj2.color.push('blue');
obj2.color.push('red');
obj2.color.push('yellow');
obj2.cat = 'Fluffy';
obj2.state = {complete: false};
console.log('obj2 color = ' + JSON.stringify(obj2.color) + ', obj2.cat = ' + obj2.cat + ', state = ' + JSON.stringify(obj2.state));
console.log('obj color = ' + JSON.stringify(obj.color) + ', obj.cat = ' + obj.cat + ', state = ' + JSON.stringify(obj.state));
Result
obj2 color = ["white","blue","red","yellow"], obj2.cat = Fluffy, state = {"complete":false}
obj color = ["white","blue","red","yellow"], obj.cat = Kitty, state = {}
The string property 'cat' in the new obj2 has the expected behaviour and is independent from that property in the prototype object 'obj'. Same with the object property 'state'.
However, on the array 'color', when I change the array, it also changes on the prototype object!
Is that intended in Javascript? For me, coming from an object-oriented background, this is totally unexpected. I see no logic in that. What is different about an array?
I could even see some logic if value-types like strings would behave different than an object property but they do not (as this example shows) - yet arrays behave differently.