[javascript] Add dynamic key, value pairs to JavaScript array or hash table