前端js下划转驼峰命名

下划转驼峰命名,直接上代码

/**
 * 下划转驼峰
 */
function camelCase(str) {
    
    
  return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase())
}

猜你喜欢

转载自blog.csdn.net/weixin_44244230/article/details/124626765
今日推荐