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 };