KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have object literal what I consider as base object: var obj = { key1 : 'value1', key2 : 'value2' } and would like to use this object and pass it to function with extention like myFunction( obj + { key3 : 'value3' } ); // param became: { key1 : 'value1', key2 : 'value2', key3 : 'value3' } or myFunction( obj + { key2 : 'new value2' } ); // param became: { key1 : 'value1', key2 : 'new value2' } + operator is not correct for it. How I can do it? Is it a way ? EDIT: Do you want to permanently alter obj ? - No, I would like to able to reuse it for next call as base.
Tags (comma-separated)
Save Edits
Cancel