下划线字符串camel

const camel = (str) => {
    let slices = str.split('_');
    let result = [];
    for(let i = 1, len = slices.length; i < len; i++) {
        slices[i] = slices[i].charAt(0).toUpperCase() + slices[i].substring(1);
    }
    return slices.join('');
}
原文地址:https://www.cnblogs.com/shineyao/p/7499179.html