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.
This is the best I've seen so far. Very clever!
I had the same solution but without the '+' and of course got a string returned. Had to google this unary plus and learned something really cool and valuable today thanks to you. Thanks!
I would say that's a bit messy syntax. Function should be declared at least with 'const' keyword.
Hey, better ask codewars team, though I've heard they abandoned this project, lol. Have a nice day!
Hey my solution is exactly the same yet it's not grouped with this one. Why?
well, this kata doesn't do that. And, + is an operator.
Well i get that but what is it, an operator or something? I think i missed it, also what if a string doesn't have numbers in it
It converts it to a number, fairly obvious 😉
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
if
text
contains no acceptable characters, this function will throw an error aswing
will benull
(and there is nojoin
method fornull
).Definately the best solution since author gets wing just as regexp result with no need to convert string into array in one more operation (what we see in ZozoFouchtra solution).
Ah very clever! I feel like this should have more votes.