Convert kebab-case to camelCase with JavaScript

You can also try regex. camelize = s => s.replace(/-./g, x=>x[1].toUpperCase()) const camelize = s => s.replace(/-./g, x=>x[1].toUpperCase()) const words = [“stack-overflow”,”camel-case”,”alllowercase”,”allcapitalletters”,”custom-xml-parser”,”api-finder”,”json-response-data”,”person20-address”,”user-api20-endpoint”]; console.log(words.map(camelize)); Looks only for hyphen followed by any character, and capitalises it and replaces the hyphen+character with the capitalised character.

What’s the name for hyphen-separated case?

There isn’t really a standard name for this case convention, and there is disagreement over what it should be called. That said, as of 2019, there is a strong case to be made that kebab-case is winning: https://trends.google.com/trends/explore?date=all&q=kebab-case,spinal-case,lisp-case,dash-case,caterpillar-case spinal-case is a distant second, and no other terms have any traction at all. Additionally, kebab-case has … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)