Intermediate Algorithm Scripting - Spinal Tap Case

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

function spinalCase(str) {
  let a = "";
  for (let i = 0; i < str.length; i++) {
    a = str.toLowerCase();
  }
  console.log(a);
  return a;
}

console.log(spinalCase('This Is Spinal Tap'));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Intermediate Algorithm Scripting - Spinal Tap Case

Link to the challenge:

Can anyone please tell me how am i supposed to put dashes here?

This challenge is going to be much easier if you use functional programming methods such as replace, split, join, trim, etc…

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.