SOURCE

function deal(str) {
    return str.replace(/-(\w)/g, function($0, $1) {
        return $1.toUpperCase();
    });
}

const str = "add-add-add";
console.log(deal(str));
console 命令行工具 X clear

                    
>
console