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 would suggest to try to reverse the way you get to seconds from a year
Please don't spoil solutions. Users are not supposed to find solutions to the kata on the discourse page...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
names[names.length - 2] will return the index of the array.
try creating a variable with the length of the array, them u can subtract
You only can unlock solutions of katas 1 level above your current level, reach lvl 5 and try again later.
well, you never declared any
length
variable :pRead this: https://docs.codewars.com/getting-started/solving-kata
After successfully passing the tests when clicking
Attempt
button, it changes toSubmit
. Click that button again to see other solutions.You should ask such questions in the solutions section. (once you submit your solution)
And it won't work until you see Node v15+ enabled in the site: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll#browser_compatibility
Find another way, without using
replaceAll
If you want to undo what you did with
split
, use the same argument withjoin
. Read the docs, they're made so you know how to use those methods.I already gave you a suggestion, I won't tell you replace X for Y, that's your job. Read the second link I posted, you're using
join
wrong, and that's the reason you neededreplaceAll
in the first place.The link is a general how to for troubleshooting your solution.
Don't use
replaceAll
, you don't need it at all. Read in MDN about the methods you use to see how to use them: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayNot a kata suggestion, please read this: https://docs.codewars.com/training/troubleshooting
About
replaceAll
it's not available in all Node's versions. Please mark your post as having spoiler content next time.