From Camel Case to Kebab Case in JavaScript

Nevin Katz
JavaScript in Plain English
3 min readJul 27, 2021

--

In this article, we will go over how to convert a string in camel case to its kebab case equivalent with a few lines of code.

camel case: nevinKatzkebab case: nevin-katz

This conversion can come in handy when you want to use an object property like dataCost in JavaScript and map it to an analogous attribute — in this case, data-cost — in…

--

--