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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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