I'm wondering, why do I sometime see functions that returns a function?
For example this answer from this question: AngularJS custom filter function
$scope.criteriaMatch = function( criteria ) {
return function( item ) {
return item.name === criteria.name;
};
};
What does it mean to have a function that returns another function that returns a value?