JavaScript(js)驼峰命名与中横线命名装换(camelCase<->kebabCase)
1.驼峰命名=>中横线命名functionkebabCase(str){consthyphenateRE=/([^-])([A-Z])/g;returnstr.replace(hyphenateRE,'$1-$2').replace(hyphenateRE,'$1-$2').toLowerCase();}kebabCase("aBXC")//"a-b-x-c"2.驼峰命名<=中横线命名functi