Convery Array of Objects untuk memetakan menggunakan Immutables JS

const sample = [{"id":"10","name":"Dave","urlName":"foo-bar","order":"-100","classId":"12","className":"David","classUrlName":"david-foo-bar"}];

const result = sample.reduce((acc, item) => {
  return acc.set(item.name, {
     id: item.id,
     urlName: item.urlName,
   })
}, new Immutable.Map())

console.log("Dave's Id", result.getIn(["Dave", "id"]));
console.log("Date's urlName", result.getIn(["Dave", "urlName"]));
Foolish Flatworm