Is there a way to assign values to multiple keys of an object without repeating the object name?
For example: We have this object created:
var obj = {
"a": 0,
"b": 0,
"c": 0,
"d": 0
}
What i want now is to assign values to some or all keys of this object which is already created(you would normally do it like this):
obj["a"] = yourValue;
obj["c"] = yourValue;
obj["d"] = yourValue;
but without repeating the object name as i did above.
Would there be a way to do such thing?
yourValueonly a primitive value?obj...