正文js 斩掉单行注释和多行注释IP云V管理员/2022-11-29/4 阅读 11/29提示:扫一扫查出行【扫一扫了解最新限行尾号】复制提示 var json = ` // e { /* hello */ name:/* a */ 'ajanuw' // c /** * * hello * ? adsd * todo */ // c } `; console.log(json.replace(/\/\/[^]*?\n/g, "").replace(/\/\*[^]*?\*\//g, '')); λ ts-node index.ts { name: 'ajanuw' }