标签: javascript immutable.js
我有一张地图列表
const myList = List([Map({name: 'arman'}), Map({name: 'abzal', age: 22}), Map({name: 'azat'})])
我想获得一个索引,例如,带有name: 'arman'
name: 'arman'
答案 0 :(得分:1)
您可以使用此类代码:
const index = myList.findIndex(one => one.get('name') === nameToSearch)