Creating a dictionary Object from an Array
You have an Array of Objects, such as:
But you want to access it as a dictionary by key, like
You need to convert your array into an Object. Use reduce for this.
To use this:
Alternatively, you can use an Array comprehension:
If you use Underscore.js, you can create a mixin: