toCamelCase Posted on 2019-09-28 Edited on 2019-10-16 In JavaScript 123456789101112131415161718192021/** * @param {string} argument1 * @param {number} argument2 strat where * @return {string} */// function toCamelCase(str, start = 0) {// return str// .split("-")// .map((v, i) => {// if (i >= start) {// return v[0].toUpperCase() + v.slice(1);// }// return v;// })// .join("");// }function toCamelCase(str: string, start = 0): string { return str.replace(/-(\w)/g, (match, matchItem) => matchItem.toUpperCase())}