6

This is my object literal:

var obj = {key1: value1};

How can I add

{key1: value1,value2,value3}

to obj?

1 Answer 1

7

The value of your object would have to be an array or object that stores the separate values, like so:

{key1: [value1,value2,value3]}

Or

{key1: new compositeValue(value1, value2, value3)}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Looks like I have to wait another 13 minutes before I can accept

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.