I am searching for individuals above the age of 21.
const people = [
{0: {name: 'john', age: 30}},
{1: {name: 'jay', age: 33}},
{2: {name: 'cris', age: 18}}
];
The code snippet provided below did not produce any results.
const result = people.filter(person => person.age >= 21);
console.log(result);
The numbers 0, 1, and 2 represent the indices of the array.