Tell us what’s happening:
I’m unable to pass this test case
" spinalCase("thisIsSpinalTap")
should return the string this-is-spinal-tap
"
How to convert non-spaced sentence with ’ - ’ ??
I’m getting this O/p : - thisisspinaltap
Your code so far
function spinalCase(str) {
let space = (/\s+|_+/g);
let string = str
.replace(space,"-")
.toLowerCase();
return string;
}
console.log(spinalCase('thisIsSpinalTap'));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Challenge: Intermediate Algorithm Scripting - Spinal Tap Case
Link to the challenge: