📜  在数组中过滤数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:39.307000             🧑  作者: Mango

代码示例1
//you can do a .map to iterate over the first level array
// and return an object that have all the other things in the array with spred operator
// and add a new property that will be the second level array filtered
arrayTier1.map((item) => {
        return ({...item, arrayTier2: item.arrayTier2.filter(subitem => subitem.value == 2)});