I have an associative array in JS.
var array = { \'one\' : \'first\', \'two\' : \'second\', \'three\' : \'third\' };
How can I add
array['newpair'] = 'new value';
or
array.newpair = 'newvalue';
This is quite a decent read on the subject.
It's an object literal, not really an "associative array".
Just do array['something'] = 'something';
array['something'] = 'something';