It's not intended to be understood. Readable code would be
function(acc,val) { if ( val in acc ) acc[val] += 1; else acc[val] = 1; return acc; }
And there you see why it was written unreadably - it's shorter. Note that acc[val] may be undefined.
acc[val]
undefined
Neat and clever
What is the use of having plus sign in the year function?
This is the first time for me to recognize that concat() method can take more than one array as it's parameters!
It's hard to have test cases because it depends on random values. just skip the test code step and try the attempt option directly
This comment is hidden because it contains spoiler information about the solution
Yeah same question,I would like to hear explanation
Good job!
Loading collection data...
It's not intended to be understood. Readable code would be
And there you see why it was written unreadably - it's shorter. Note that
acc[val]
may beundefined
.Neat and clever
What is the use of having plus sign in the year function?
This is the first time for me to recognize that concat() method can take more than one array as it's parameters!
It's hard to have test cases because it depends on random values.
just skip the test code step and try the attempt option directly
This comment is hidden because it contains spoiler information about the solution
Yeah same question,I would like to hear explanation
This comment is hidden because it contains spoiler information about the solution
Good job!