how to create duplicate key array in javascript

Solutions on MaxInterview for how to create duplicate key array in javascript by the best coders in the world

showing results for - "how to create duplicate key array in javascript"
Elizabeth
08 Aug 2016
1var obj = {
2  key1: []
3};
4
5obj.key1.push("something"); // useing the key directly
6obj['key1'].push("something else"); // using the key reference
7
8console.log(obj);
9
10// ======= OR ===========
11
12