Plz help me masters. If I have data composed of objects, how can I filter them through their property value.
{id: 1, title: Tom, FinalTest: true},
{id:2, title: Maggie, FinalTest: false},
{id:3, title: Jake, FinalTest: true}
I want to filter object which propety FinalTest is true.
result
{id: 1, title: Tom, FinalTest: true},
{id:3, title: Jake, FinalTest: true}
May be this will help you:
const test = [
{ id: 1, title: "Tom", FinalTest: true },
{ id: 2, title: "Maggie", FinalTest: false },
{ id: 3, title: "Jake", FinalTest: true },
];
const result = test.filter((t) => t.FinalTest === true);
console.log(result)