<script>
function changeFormat(str) {
return str.replace(/-(\w)/g, function(k, r) {
return r.toUpperCase()
})
};
console.log(changeFormat("font-size"));
</script>
转载于:https://www.cnblogs.com/mouse2417/p/5165373.html
<script>
function changeFormat(str) {
return str.replace(/-(\w)/g, function(k, r) {
return r.toUpperCase()
})
};
console.log(changeFormat("font-size"));
</script>
转载于:https://www.cnblogs.com/mouse2417/p/5165373.html