JSFiddle - React, Tailwind, and code Playground

JavaScript

var players = [{id: 2, score: 5}, {id: 2, score: 10}]

var mapped = _.map(players, function(x) { return {x.id: x}})

console.log(mapped)