創建從對象數組的int數組我有這樣的對象數組:使用lodash
this.clients=[{firstName:"Tywin", lastName:"Lannister", age:46, id:2},
{firstName:"Arya", lastName:"Starck", age:46, id:-1},
{firstName:"John", lastName:"Snow", age:46, id:12},
{firstName:"Robb", lastName:"Starck", age:46, id:24}];
而且這個變量:
我需要循環把所有的對象數組中,並得到所有像這樣:
idArr = [2,-1,12,24]
我該如何使用lodash實現它?
你有搜索?你有什麼發現? – nicael
lodash的例子不足以解決這個問題嗎?似乎沒有對此做任何研究努力 – charlietfl