Answers for "how to create duplicate key array in javascript"

0

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 ===========
Posted by: Guest on July-02-2020

Code answers related to "how to create duplicate key array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language