Javascript, syntax after function -
i have function changes object me , i'm wondering how bit of works , grateful if explain or point me in right direction. here function:
$scope.filteredobject = object.keys($scope.filterobject).reduce(function(p, collection) { var values = $scope.filterobject[collection]; p[collection] = object.keys(values).filter(function(key) { return values[key] === true; }).map(function(key) { return key; }); return p; }, {});
so works great, i'm wondering }, {});
@ end of function exactly. im not sure name of , googleing "}, {}
after function in javascript" seems confuse hell out of google (lol). thanks!
}
- end of anoymous function expressionfunction(p, collection) { … }
,
- delimiter between multiple arguments{}
- (empty) object literal, second argument)
- end of function invocation, closing parentheses arguments list.reduce(…)
Comments
Post a Comment