SOURCE

console.log('asfsgsdddgggdgdgg'.replace(/(.)(\1+)/g, function($1,$2){ 
    return $2;
}));
console 命令行工具 X clear

                    
>
console