I have an array filled with objects, each representing a individual heading to a movie theater. These objects include properties like Name, Age, and Hobby. If there is at least one person under 18 years old, the variable censor should be set to true.
Despite Tim being younger than 18, my code below currently returns false. Am I not using .some() correctly in this situation?
var persons = [
{Name: "Joel", Age:25, Hobby:"Fishing"},
{Name: "Michael", Age:31, Hobby:"Astronomy"},
{Name: "Tim", Age:12, Hobby:"Video Games"},
]
var censor = persons.some((person) => {person.Age < 18})
console.log(censor) --> false