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.
i had a similar issue - i was counting the days, hours, etc in a global dictionary that wasn't resetting between tests. i fixed mine by moving the dictionary to the local scope.
You mean, it isn't in the sample tests, the final tests have two tests with a similar string. That's normal, sample tests are just that.
Sorry, I fixed it. I reseted and inserted my code again and it works. Thank you, guys.
You're trying to use those methods on
undefined
, that's literally what the error says. Try usingconsole log
to debug the issue or post your code here (with proper formatting)But my code working in VScode with Node, and on the site error is "TypeError: Cannot read property 'charCodeAt' of undefined
at toCamelCase
at /home/codewarrior/index.js:24:23
at /home/codewarrior/index.js:22:4
at Object.handleError
(anonymous function) [as .js]"
Probably you're using them with something that's not a string.
This comment is hidden because it contains spoiler information about the solution
maybe i'm reading your question wrong ... have you tried out dumping output on the page? the final tests are different, and go into the "years"
mmmh... I bet on ordering problems.
Read the message just below and my answer.
markdowns, plz, so that the code is readable...
and you still didn't paste the assertion message you get on cw.
This comment is hidden because it contains spoiler information about the solution
how could we tell since you don't give any actionnable information, neither about the way your code is failing (error? assertions messages?) nor about what your code is...? :o (note: do never post code without a spoiler flag)
So, being limited to wild guesses, I'd bet on global variables?
if name=='main':
assert(format_duration(1)=="1 second")
assert(format_duration(62)=="1 minute and 2 seconds")
assert(format_duration(120)=="2 minutes")
assert(format_duration(3600)=="1 hour")
assert(format_duration(3662)=="1 hour, 1 minute and 2 seconds")
These tests in my IDE pass without errors, but only the first passes on the site. What am I doing wrong?