1let data = [
2 {id: 1, country: 'Germany', population: 83623528},
3 {id: 2, country: 'Austria', population: 8975552},
4 {id: 3, country: 'Switzerland', population: 8616571}
5];
6
7let dictionary = Object.assign({}, ...data.map((x) => ({[x.id]: x.country})));
8// {1: "Germany", 2: "Austria", 3: "Switzerland"}
9