The value to be converted to kebab-case string
Optionalscream: booleanOptionally return the result as UpperCase (Screaming).
The kebab-cased version of the provided value
strKebabCase(null); // "null"
strKebabCase(undefined); // "undefined"
strKebabCase("hello darkness"); // "hello-darkness"
strKebabCase("hello_darkness"); // "hello-darkness"
strKebabCase("_hello_darkness"); // "-hello-darkness"
strKebabCase("hello darkness, my old friend."); // "hello-darkness-my-old-friend-"
// Add optional SCREAM flag
strKebabCase("hello darkness", true); // "HELLO-DARKNESS"
strKebabCase("hello_darkness", true); // "HELLO-DARKNESS"
strKebabCase("_hello_darkness", true); // "-HELLO-DARKNESS"
strKebabCase("hello darkness, my old friend.", true); // "HELLO-DARKNESS-MY-OLD-FRIEND-"
Convert the provided value to
kebab-casedstring, you can optionally specify whther the result is all uppercased by passingtrueas the optionalscreamargument, otherwise the entire result will be lowercased. If the value is not a string it will be converted.