Daud Daud - 3 months ago 60x
AngularJS Question

Which javascript construct is this AngularJS filter expression?

If we wish to use a filter in AngularJS on the controller side, we use this

$filter('filter')(array, expression, comparator, anyPropertyKey)

I can't understand which javascript construct is this using. I mean, its not a function, its not an assignment expression, its not a self-executing function. What is it ?


It's a function which returns a function which you then execute.

function foo() {
    return function bar() {};


// equivalent to:
var b = foo();