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.
Use console.log() to print your answer before returning
This comment is hidden because it contains spoiler information about the solution
You're trying to read the length of
null
, that's what the error says. You have to check if it is an array first.I really have no clue but I get the results below.
I thought if you get all the assertions it's a full pass if someone could explain I would love it.
I'm defintely trying to learn.
KataTests
Basic Tests (6 of 6 Assertions)
Random Tests (40 of 40 Assertions)
Test Passed: Value == 0 (<---Obviously just one of the passed tests but right below it is the error)
TypeError: Cannot read property 'length' of null
at getLengthOfMissingArray
at /home/codewarrior/index.js:45:23
at begin
at it
at /home/codewarrior/index.js:34:3
at /runner/frameworks/javascript/cw-2.js:152:11
at Promise._execute
at Promise._resolveFromExecutor
at new Promise
at describe
at /home/codewarrior/index.js:33:5
at /home/codewarrior/index.js:81:5
at Object.handleError
This comment is hidden because it contains spoiler information about the solution
In JavaScript I just floored seconds and it worked without any rounding. Had frustrated experience because of this "round it to nearest second".
After reading issues section I confirmed what I suspected, author derped a bit here and refused to accept that.
Some of the tests are mathematically incorrect.
Edit: NVM, rounding down is not rounding, it is flooring.
For the race(80, 100, 40) I continue to get [1, 59, 59] instead of [2, 0, 0]. I'm using Javascript.
If I use round in some places it works but then the other tests break.
Not looking for the answer but I'm so close.