var array = [
{
name: "john",
age: 23,
isMarried: true
},
{
name: "mike",
age: 16,
isMarried: false
},
{
name: "joey",
age: 32,
isMarried: true
}
];
Let's suppose we have this array list, I am trying to filter this array without mutating the original array with multiple conditions which will return me a result array with all the conditions matched.
conditions can be if age> 20 && isMarried === true;
Note: The values in the array might be null sometimes.
Thanks in advance