[Solved] How to filter an array with multiple parameters


You don’t have pageTypeId property in the object. Because of that, i changed this property to id in the statement, and if you want filter value 1 or 2, i used || characters. Maybe you will edit your code like this, it will work.

let tmpArray = [{"id":"1"},{"id":"2"},{"id":"2"},{"id":"3"},{"id":"3"}];
this.nodes = tmpArray.filter(x => {
    return x.id.toString() == "1" || x.id.toString() == "2";
});

5

solved How to filter an array with multiple parameters