1const myUsers = [
2 { name: 'shark', likes: 'ocean' },
3 { name: 'turtle', likes: 'pond' },
4 { name: 'otter', likes: 'fish biscuits' }
5]
6
7const usersByLikes = myUsers.map(item => {
8 const container = {};
9
10 container[item.name] = item.likes;
11 container.age = item.name.length * 10;
12
13 return container;
14})
15
16console.log(usersByLikes);