Tell us what’s happening:
just tested it on codepen, and this code passes al the tests, while FCC compilator keeps saying that i dont pass some chalengies. What’s wrong?
Your code so far
function spinalCase(str) {
// "It's such a fine line between stupid, and clever."
// --David St. Hubbins
let newArr=str.toLowerCase()
.split(/\W+/)
.join('-');
return newArr;
}
spinalCase('This Is Spinal Tap');
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case