Closed hkgmahwa closed 4 years ago
Sorry, I never saw this. 😢
Basically the function is going through the list of items and adding them to the counts
array. If the object doesn't yet exist, it's push
ed onto the array with a count of 1 (counts.push({name, count: 1})
. However in order to determine if counts
already has the name, it searches counts
. counts
contains objects of the form {name: 'blah', count: XXX}
. So c.name
is just the name of an item that's already been added.