Curly braces at the end of a reduce() call

Hello all!

I have a question about the example shown in this challenge.

const users = [
  { name: 'John', age: 34 },
  { name: 'Amy', age: 20 },
  { name: 'camperCat', age: 10 }
];

const usersObj = users.reduce((obj, user) => {
  obj[user.name] = user.age;
  return obj;
}, {});
console.log(usersObj); // { John: 34, Amy: 20, camperCat: 10 }

Why is that last pair of curly braces {} there at the end of the reduce() method? What is it’s purpose?

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.

Challenge: Use the reduce Method to Analyze Data

Link to the challenge:

the reduce method accept a second optional argument, that argument would be the starting value of the accumulator (in this case of the callback parameter obj), otherwise the starting value is the first item in the array

The signature of .reduce() looks like this:
array.reduce( function(accumulator, nextVal, index, array) {// your code here}, ?initAccumulatorVal);

So the empty object passed in as the second parameter to .reduce() will serve as the initial value of the accumulator, while nextVal will be assigned the first item in the array. If no initial value is provided then the accumulator will be assigned the first item in the array, and nextVal will be assigned the second item in the array (in the first iteration of the loop, that is).