Converts a string to camel casing. For example, 'hello world' becomes 'helloWorld'.
Contributed by @itsbrunodev
function toCamelCase(str) {
return str.replace(/\W+(.)/g, (match, chr) => chr.toUpperCase());
}
toCamelCase("hello world"); // "helloWorld"