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 really liked this solution, however I found a little bug.
The '.' in 'www.' currently matches any character, which means if my input is 'wwwsomething.com' the function will return very weird values, depending on the number of w's.
I suppose you meant to write that as 'www\.', to match only dots.
The best way! I keep forgetting that I don't need to explicity write true and false because the comparison operator always does that automatically for me.
lgfm
gangsta
I've just tested your solution and it passed the kata without any errors, so closing...
Arrow functions are not IIFE. This is just their syntax. If they are one line expressions they don't need return. But if they contain several lines of code, then they need return statement and curly braces around code block.
Does this work without the return statement because arrow functions are 'immediately invoked functions?'
!
is a regular character in JS regex, but?
is a special character (the "zero or one" quantifier in this specific instance) which has to be escaped./!/g how did it work without scaping like this /?/g
This comment is hidden because it contains spoiler information about the solution
I think this is the best way to do it, readable and effecient.
Well done!
we can use shorter variable names
Great!
No semicolon ftw 💪
I didn't understand how word[index] worked into map. Anyone could explain me it?
Loading more items...