1String.prototype.toCamelCase = function () {
2 let STR = this.toLowerCase()
3 .trim()
4 .split(/[ -_]/g)
5 .map(word => word.replace(word[0], word[0].toString().toUpperCase()))
6 .join('');
7 return STR.replace(STR[0], STR[0].toLowerCase());
8};
1String.prototype.camelCase=function(){
2 return this.split(/[ -_]/g).map(function(word){
3 return word.charAt(0).toUpperCase() + word.slice(1);
4 }).join('');
5}