Tell us what’s happening:
this is my take on the problem. i have successfully passed 3/4. the only thing messing up my solution is that extra white space after ‘telebubbles’. how do i progress further? i’m not good with replace
**Your code so far**
function spinalCase(str) {
let k=str.split(/[\s-_]?(?=[A-Z])/g).join('-').toLowerCase()
console.log(k)
return k
}
spinalCase('This Is Spinal Tap');//passed
spinalCase("thisIsSpinalTap")//passed
spinalCase("The_Andy_Griffith_Show")//passed
spinalCase("Teletubbies say Eh-oh")//not working
spinalCase("AllThe-small Things")//passed
**Your browser information:**
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36