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 expression function(p, collection) { … }
  • , - delimiter between multiple arguments
  • {} - (empty) object literal, second argument
  • ) - end of function invocation, closing parentheses arguments list .reduce(…)

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -