javascript dictionary from two arrays

Solutions on MaxInterview for javascript dictionary from two arrays 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 - "javascript dictionary from two arrays"
Nicole
02 Jun 2016
1var keys = ['foo', 'bar', 'baz'];
2var values = [11, 22, 33]
3
4var result = {};
5keys.forEach((key, i) => result[key] = values[i]);
6console.log(result);