const snakeToCamelCase = (s) => s.toLowerCase().replace(/(_w)/g, (w) => w.toUpperCase().substr(1)); const str1 = 'learn_javascript'; console.log(snakeToCamelCase(str1)); // learnJavaScript