function toCamelCase(str) { var pattern = /-([a-z])/g return str.replace(pattern,function(all,letter){ return letter.toUpperCase(); }) } console.log(toCamelCase(str))
function toCamelCase(str) { var pattern = /-([a-z])/g return str.replace(pattern,function(all,letter){ return letter.toUpperCase(); }) } console.log(toCamelCase(str))