The  is no needed in this case. sum() can run on iterable object.
Hello. The function returns a single location, but a bug report reports that 2 positions have been received. console.log() shows return value. Is it possible that task verification has a problem?
very clean and clear
How did you noy run out of time? I had the very same solution and run out of time...
It also creates [bags,bags,bags, [bags,bags,bags], [bags[i+3]] and [bags[i+5]] ( if they aren't optimised away ).
Kata's don't need to describe reality, they just need to propose problems (description updated).
Still a better love story than Twilight.
I can't agree with you anymore. So many people like write a long statement in a line……
I know it was old but any chance I get to vent my hatred for ES5, I take it :D
That comment was from 2 years ago.
Also, it doesn't help that every single entry level programming site (e.g cough Codecademy and FCC) are all still teaching ES5 and treating ES5 as the norm. Even their linter is set to ES5 and will warn you for using ES6 features (e.g =>).
Pre-ES6 JS is garbage though :x
Absolutely! In fact, I couldn't quite understand it all until I switched to classes and trimmed all that unneccessary code.
added tests to check for this.