asked on
var futureStudents = [
{name: "Alex", age: 30},
{name: "Sara", age:20},
{name: "Mark", age: 13},
{name:"Charlotte", age: 3},
{name: "Taylor", age: 18}
];
//code here
//this is what I've come up with
var oldEnough=futureStudents.filter(
function(val){
if(num.val>=18){
return futureStudents.name;
}
});
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
Open in new window
This function should return true for any element that matches the condition, and false otherwise.
It should use the 'val' object, which represents the current value within the array.
You should not be accessing the entire 'futureStudents' array anywhere within that function.
Do these clues help point you in the right direction?