javascript – Counting duration values

I have a durations as such:

[{'duration': 3600}, {'duration': 3600}]

And I want the output to be {3600: 2}, where 2 is the number of occurrences of 3600.

My first attempt is to use a loop, as such:

                var account = {};
for (var d of durations) {
length var = d.duration;
yes (length in account) {
tell[length] + = 1;
}
else {
tell[length] = 1;
}
}
console.log (account);

The second attempt uses reduce () in lodash:

                foo function (result, value) {
var length = value.duration;

if (length in the result) {
result[length] + = 1;
}
else {
result[length] = 1;
}

return result
}
var reduced = _.reduce (durations, foo, {});
console.log (reduced);

As can be seen, this second attempt remains as detailed as before.

Is there any way to write the iterative function? foo More in accordance with functional programming?