str.kebabToCamelCase()

from kebab case (this-is-kebab-case) to camel case (thisIsCamelCase)

🔰 JSTypesStringmethods


// ⭐️ string.kebabToCamelCase()
// kebab case  | camel case
// aaa-bbb-ccc | aaaBbbCcc
String.prototype.kebabToCamelCase = function() {
    return this
      .split('-')
      .map((str, i) => (i === 0 ? str : str.capitalize()) )
      .join('');
};

Last updated