我有兩個數組,餘額和承諾underscorejs如何比較兩個數組?
balances = [
{name: 'vacation', value: ''21},
{name: 'account', value: '200'},
{name: 'order', value: '15'},
]
commits = [
{balanceName: 'vacation', paramName: 'number of days'},
{balanceName: 'order', paramName: 'number of items'}
]
我想刪除表格餘額究竟是不是在犯,在這個例子中,我想刪除餘額賬戶價值的原因是沒有在任何的balanceName的提交 如何通過下劃線或任何其他庫執行此操作
您可以參考此鏈接https://stackoverflow.com/questions/10110510/underscore-js-determine-if-all-values-in-an-array-of-arrays-match –
可能的重複[如何過濾數組時,對象的鍵值是在數組中](https://stackoverflow.com/questions/35817565/how-to-filter-array-when-object-key-value-is-in-array) –