Apply-functional-programming-to-convert-strings-to-url-slugs

Apply-functional-programming-to-convert-strings-to-url-slugs
0

#43

I found the mistake, I should have added + on W so it is W+ which means find one or more spaces, and changed trim to be the first method


#44

I used match for any non white space repeating characters.
However, I am curious which is more efficient between using Filter, Map, Trim, or etc.

return title.toLowerCase().match(/\S+/g).join('-');