转换为驼峰命名法
var s1 = "get-element-by-id"; 给定这样一个连字符串,写一个function转换为驼峰命名法形式的字符串 getElementById
匹配 ' - '
对后面的首字母大写
replace
的语法
其中function
的回调参数有
| The matched substring. (Corresponds to $& a |
| The nth string found by a parenthesized capture group, provided the first argument to |
| The offset of the matched substring within the whole string being examined. (For example, if the whole string was |
| The whole string being examined. |
最后更新于