They will be created on the fly. An alternative notation would be
obj[key] = value
.
They are not really associative arrays actually. It's an object with properties, so you won't be able to use it in the same way you would use an array (e.g.
for (var i = 0, len = obj.length; i < len; ++i) {}
)
If you were to loop through it, you need to do as following
var o = {};
o.key1 = 'value1';
o.key2 = 'value2';
for (var key in o) {
if (!o.hasOwnProperty(key)) continue;
var value = o[key];
}