Closed zhoukekestar closed 7 years ago
驼峰转连字符
const nameTransformer1 = name => name.replace(/([A-Z])/g,"-$1").toLowerCase();
连字转驼峰
const nameTransformer2 = name => name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
chrome 调试,https://zhoukekestar.github.io/notes/chrome/note/2017/02/13/chrome-note.html
调试临时 vm js 文件: //@ sourceURL=dynamicScript.js, 参考, https://stackoverflow.com/questions/17367560/chrome-development-tool-vm-file-from-javascript
Maybe this code is better: