Comment convertir la chaîne en cas de kebab dans javascript

const kebabCase = (string) => {
  const kebabCase = string => string
      .replace(/([a-z])([A-Z])/g, "$1-$2")
      .replace(/[\s_]+/g, '-')
      .toLowerCase();

  const newText = kebabCase(string);
  return newText
};
mrmalik610