Extend a direct instance
- by Diolor
We have a new instance of an object with four properties:
person={firstname:"John",lastname:"Doe",age:50,eyecolor:"blue"};
What is the best way to many other properties to that object?
If we wanted few couple more sure we would:
person[address_no] = 4;
....
person[country] = 'Netherlands';
But what if we have a lot properties. Is there any minimalistic way like the one below? (I know it doesn't work)
person +={address_no: '4', .... , country: 'Netherlands'};