I have a function called as
getFileterMenus = (menus, filterMenu) => {
let filteredMenus = _.filter(menus, menu => menu.title !== filterMenu)
return filteredMenus
}
Here filterMenu
I want to pass it as an array . which will be like ['first', 'second'] like this. I want to keep a filter function as well..
I tried
getFileterMenus = (menus, filterMenu) => {
let filteredMenus = []
for (let i = 0; i <= filterMenu.length - 1; i++) {
filteredMenus = _.filter(menus, menu => menu.title !== filterMenu[i])
}
return filteredMenus
}
Is there any other way to do this than using a loop ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…