[JS] Map loop
```js let recipeMap = new Map([ [‘cucumber’, 500], [‘tomatoes’, 350], [‘onion’, 50] ]);
```js let recipeMap = new Map([ [‘cucumber’, 500], [‘tomatoes’, 350], [‘onion’, 50] ]);
Simple example to use react-router history to prevent the user leaving the page.
Simple example shows that JS Map keeps the keys compare to an object does not keep the different data type of keys.
Simple example of convert an object to a map.
When copying an array with spread operator (…) is a shallow copy. Which means if the array containing an object will be still pointing same object not copyin...