http://www.quora.com/What-is-a-simple-explanation-of-higher-order-functions-and-callbacks-in-JavaScript
var animals = [
{ name: 'Waffles', type: 'dog', age: 12 },
{ name: 'Fluffy', type: 'cat', age: 14 },
{ name: 'Spelunky', type: 'dog', age: 4 },
{ name: 'Hank', type: 'dog', age: 11 },
];
var oldDogs = animals.filter(function(animal) {
return animal.age > 10 && animal.type === 'dog';
});
No comments:
Post a Comment