I have the following:
var x = {
'a' : 1,
'b' : 2
}
Then, I want to add the following to the object (my pseudocode):
x += {
'c' : 3,
'd' : 4
}
This obviously doesn't work as expected.. I basically end up with a "[Object][Object]" string. But what I really want is this:
var x = {
'a' : 1,
'b' : 2,
'c' : 3,
'd' : 4
}
I feel like there should be some sort of built-in operator or easy way to do this, other than just individually adding the properties or using a loop. But maybe I am wrong. Thoughts?