Sorry for my silly question.I have a list of users like this:
const users = [
{ name: "Jimmy", skills: ["Docker", "JavaScript", "Ruby"],age:20},
{ name: "Jimmy", skills: ["AWS", "Python"],age:15 },
{ name: "Frankie", skills: ["Azure", "JavaScript"],age:21},
{ name: "Liam", skills: ["Java", "JavaScript"],age:22},
{ name: "Fred", skills: ["JavaScript", "AWS"],age:34 },
{ name: "Sara", skills: ["PHP", "AWS"],age:23 },
{ name: "Matt", skills: [".Net", "PHP", "Docker"],age:25 },
{ name: "Matt", skills: [".Net", "PHP", "Docker"],age:10 },
];
I want to filter out Matt with the age of 25
const JavaScriptApplicants = users.filter(o => o.name !== 'Matt' && o.age !== 25);
console.log(JavaScriptApplicants)
But it filters out another one with age 10. I just want the 25 gone.
&&to||true. Ifo.nameis Matt theno.name !== Mattwill befalse, making the entire expression evaluate tofalse, on the other hand,||will ensure that the name is both Matt and the age is 25 before evaluating tofalse