Javascript - How to compare property values in objects in an array
Initialize won
with a value:
let won = 0;
Otherwise, won
is equal to undefined
in the beginning.
undefined
+ 1 will give you NaN
(Not-A-Number).
NaN
+ 1 will give you NaN
again.