Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Beautiful!
@benbrnpetit for larger datasets push will be more performant than unshifting. When you add an element to the end of an array, it can be done instantly. When you unshift and array, you must move the entire array forward, which takes more time with larger arrays of data
how? or this sarcasm?
Nice and simple solution) Cool!
This comment is hidden because it contains spoiler information about the solution
soo dumb!
may be a stupid question of a JS beginner but - why there is 'i < data.length' instead of 'i < data.length - 7'?
Nice use of spread syntax.
console.time() gives me around 0.115ms for both methods.
exactly
from the end through the push will be faster
This type of thing is often the best solution to a problem!
No worries, I can translate to haskell and ruby if you are looking for translations, just send me a message on gitter.
Thank you! I appreciate the advice very much. I'll try to think of a better way to make this problem something different (and I'll probably unpublish it if I can't, and work on something else of course).
Loading more items...