javascript dictionary from two arrays

Solutions on MaxInterview for javascript dictionary from two arrays by the best coders in the world

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);