Created
December 21, 2017 03:43
-
-
Save JackHowa/433afe84ad22397e1217b412ccf9e56e to your computer and use it in GitHub Desktop.
ccc spinal case challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes. | |
function spinalCase(str) { | |
return str.toLowerCase().replace(/ |_/gi, '-'); // use the | for or matching | |
// need to find match case [a-z] sequence | |
} | |
spinalCase('This Is Spinal Tap'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment