JavaScript Algorithm: Convert String to Camel Case

Convert dash and or underscore delimited words into camel casing

Max N
Level Up Coding
Published in
3 min readJan 10, 2022

--

Photo by Aman Kumar on Unsplash

We are going to write a function called toCamelCase() that will accept a string, str, as an argument.

For this function, you are given a string and the words in the string are separated by either a dash or an underscore _ or both. The goal of…

--

--

A writer that writes about JavaScript and Python to beginners. If you find my articles helpful, feel free to follow.