Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to create duplicate key array in javascript

var obj = {
  key1: []
};

obj.key1.push("something"); // useing the key directly
obj['key1'].push("something else"); // using the key reference

console.log(obj);

// ======= OR ===========

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #duplicate #key #array #javascript
ADD COMMENT
Topic
Name
6+4 =