SOURCE

// 转化为驼峰
// 涉及字符串方法,toUpperCase
let s1 = "get-element-by-id"

// 转化为 getElementById
function aaBbCc(s){
    return s.replace(/-\w/g,val=>{
        return val.slice(1).toUpperCase()
    })
}
console.log(aaBbCc(s1))

console 命令行工具 X clear

                    
>
console