function spinalCase(str) {
  let r = /\s+|\_+/gi;
  let tempStr = str.replace(/([a-z])([A-Z])/g, "$1 $2");
  let newStr = tempStr.replace(r, '-');
  return newStr.toLowerCase();
}
// Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.
Convert a string to spinal case.
Convert a string to spinal case .
function spinalCase(str) {
  let r = /\s+|\_+/gi;
  let tempStr = str.replace(/([a-z])([A-Z])/g, "$1 $2");
  let newStr = tempStr.replace(r, '-');
  return newStr.toLowerCase();
}
function spinalCase ( str ) { let r = / \s+|\_+ / gi ; let tempStr = str . replace ( / ([a-z])([A-Z]) / g , "$1 $2" ) ; let newStr = tempStr . replace ( r , '-' ) ; return newStr . toLowerCase ( ) ; }
Convert a string to spinal case.
Convert a string to spinal case .