82
rated 0 times
[
89]
[
7]
/ answers: 1 / hits: 43936
/ 11 Years ago, tue, may 7, 2013, 12:00:00
I want to add multiple attributes to an existing object with existing attributes. Is there a more concise way than one line per new attribute?
myObject.name = 'don';
myObject.gender = 'male';
Everything on MDN shows how to do new objects with bracket notation, but not existing objects: https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Working_with_Objects
More From » oop