题解 | #将字符串转换为驼峰格式#
将字符串转换为驼峰格式
http://www.nowcoder.com/practice/2ded24e34ec34325a62d42d0c8479bae
function cssStyle2DomStyle(sName) { let arr = sName.split('-') let str = '' for (item of arr) { if (item != '') str += item[0].toUpperCase() + item.slice(1) } return str = str[0].toLowerCase() + str.slice(1) }