First Method const poeple = [ {id: 1, name: 'youssef'}, {id: 2, name: 'kamal'}, {id: 3, name: 'ossama'}, {id: 4, name: 'yassir'}, ]; const poepleById = poeple.reduce((byId, item) => { byId.set(item.id, item); return byId; }, new Map()); c...
Markdown supported · ⌘↵ to post
No responses yet.