Q:

javascript add or merge to object

I am stuck. I am looking for a solution to add or create data in objects. 
For example, I start with an empty object.
var Foo = {};

How can I assign values to an object key without checking if the key "clicked" already excists? 
{
    'clicked' : [
        {'foo' : 'bar'},
        {'blah', 'blaat'}
    ]
}

Usually you would do:
Foo.clicked = [];
Foo.clicked.push({'foo' : 'bar'});
Foo.clicked.push({'blah', 'blaat'});

Is there a more elegant way to assign data to Foo without checking if the key "clicked" is already there? Some sort of merge if it excists?
I have tried something like:
Object.assign({'click' : [{'foo':'bar'}]}, {'click' : [{'blah':'blaat'}]})

but the last one is overwriting the first one.

A:

You could take a check with a logical OR || and assign an array, if the first operand (the property) is falsy.
Foo.clicked = Foo.clicked || [];
Foo.clicked.push({ foo: 'bar' });
Foo.clicked.push({ blah: 'blaat' });

