Deep jQuery.extend modifies the target's protype?
After running the following code, parent.deep.y returns "baz" even though parent is the prototype of the target.
- var parent = {
- deep: { x: "foo", y: "bar"}
- }
- var target = Object.create(parent);
- var source = {
- deep: { y: "baz" }
- };
- $.extend(true, target, source);
I expected parent.deep.y to retain it value of "bar".
Can someone please explain why is it that a deep $.extend modifies the protoype of the target?