How to stop function overwriting javascript object property and add new property instead?
<p>How can I add a new property for each element without overwriting the last property? H2 backgroundColor is overwriting H2 color in this example:</p>

<pre><code>var cssObject = {}

function updateAllCSS(element, property, value) {

        cssObject[element] = [property] 
        cssObject[element][property] = value            

}

updateAllCSS('h2', 'color', '#000')
updateAllCSS('h2', 'backgroundColor', '#FFF')


console.log(cssObject.h2.color)
</code></pre>

<p>Any help would be amazing :)</p>
