I\'m trying to use ES6 arrow function with .filter to return adults (Jack & Jill). It appears I cannot use an if statement.
.filter
What do I need to know
You can't implicitly return with an if, you would need the braces:
if
let adults = family.filter(person => { if (person.age > 18) return person} );
It can be simplified though:
let adults = family.filter(person => person.age > 18);