0

Take a look at this snippet:

$.extend( true, {}, { key: ["somevalue"] }, { key: ["anothervalue"] })

doing this I expect the produced object will contain a property called "key" which is an array and has 2 elements, e.g

{ key: ["somevalue", "anothervalue"] }

Am I just giving the deep copy more than it can handle?

1 Answer 1

1

Nop !! The result will be a object containing key having value ["anothervalue"], you are basically overriding the "key" as you pass more objects in the arguments with key as "key"

Thanks

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.