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.
Good. Not bad!)
sorry, it's 7. You're correct, I thought that the second param is 5.
Thanks for your suggestions! I will update kata.
The second number passed in is 7. Why would
numberOfPagesToDisplay
be passed in at all if it were always the same number?Already fixed, thx!
in the second example, result has to be:
getPages(2, 7, 9) == [1, 2, 3, 4, 5], because numberOfPagesToDisplay = 5.
Let's imagine that it's pagination on web-site. So to be user-friendly, pagination has always contains the same numberOfPagesToDisplay, in this case it's always 5.
Randomly generated tests would be a great addition to this kata.
Also, the description should be more explicit and clear on how things should work. eg:
Thanks!
Hahahahaha. Whoops, well it is early, my brain isnt in gear :-) I meant the DeepEquals one :-)
Random tests?
More informative descriptions?
Nonono, not assertEquals for arrays :P
Should be using assertSimilar or even better, assertDeepEquals.
Should be Test.assertEquals(getPages(7, 5, 100), [5, 6, 7, 8, 9]); :-)
To test whether arrays match use either
Test.assertSimilar()
or even betterTest.assertDeepEquals()
.There appears to be something wrong with the testing. It's accepting any solution. Also, random tests are strongly suggested.
nice!
Cool task! EcmaScript2015 helped me to complete thistricky task easy