Two sets of parentheses after function call

前端 未结 3 1467
暖寄归人
暖寄归人 2020-11-22 07:16

I was looking how filters works in Angularjs and I saw that we need to send 2 sets of parentheses.

$filter(\'number\')(number[, fractionSize])
3条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 07:34

    It is the same as this:

    var func = $filter('number');
    func(number[, fractionSize]);
    

    The $filter() function returns a pointer to another function.

提交回复
热议问题