const map = new Map(Object.entries({foo: 'bar'}));
map.get('foo'); // 'bar'
Object.fromEntries(Map)
const rockets = [
{ country:'Russia', launches:32 },
{ country:'US', launches:23 },
{ country:'China', launches:16 },
{ country:'Europe(ESA)', launches:7 },
{ country:'India', launches:4 },
{ country:'Japan', launches:3 }
];
const launchOptimistic = rockets.map(elem => (
{
country: elem.country,
launches: elem.launches+10
}
));
console.log(launchOptimistic);
Run code snippet
import { map } from "ramda"
const double = x => x * 2;
const mappedObject = map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}