I think you are wrong. Just tested. [1, 2, 3, 4, 5, 6, 7].slice(-4) will return [ 4, 5, 6, 7 ]
i needed this to understand as well, now it makes sense :D
Hackery to get shortest possible line. Not good for production work.
.slice(-number) actually reverses the elements. .slice(-4) on the array [1,2,3,4,5,6,7] will give you [7,6,5,4]. Wow !
Very clever. Instead of .join('\n') you used join<enter and thus new line>.
<enter and thus new line>
LOL. Thanks for making my morning. Hopefully you will never work on any team that I am on. But it was a great laugh.
This kata is a duplicate. Not useful to have so many duplicates.
Stupid kata if ever there was one.
Syntax correction. Not fun in Notepad.
In samples tests everything is ok but in attempt I've 9 fail and 1 exit. I don't understand why
The description for this kata is inadequate.
It is simply not clear enough.
The test cases are too few.