1. 字符串下划线转为驼峰式
1 function toCamel(str) { 2 if(typeof str!=="string") return str; 3 return str.replace(/_(\w)/g, function (a, b) { 4 return b.toUpperCase() 5 }) 6 }
标签:function,return,小用,欢迎,更新,str From: https://www.cnblogs.com/grow-up-up/p/17147144.html