当前位置:网站首页>去掉js代码文件所有注释
去掉js代码文件所有注释
2022-08-04 08:50:00 【yibucuo】
- 先把目标文件内容声明一个script变量如下
var script = `.......这里放入js代码内容.......`
- 执行下面js代码
var reg = /("([^\\\"]*(\\.)?)*")|('([^\\\']*(\\.)?)*')|(\/{2,}.*?(\r|\n|$))|(\/\*(\n|.)*?\*\/)/g;
var c = script.replace(reg, function(word) {
return /^\/{2,}/.test(word) || /^\/\*/.test(word) ? "" : word;
});
console.log(c)
- 在浏览器输入c,打印后,右键选择Copy string contents即可

边栏推荐
猜你喜欢

Yolov5 replaces the backbone network of "Megvii Lightweight Convolutional Neural Network ShuffleNetv2"

inject() can only be used inside setup() or functional components.

C Language Lectures from Scratch Part 6: Structure

Implementation of redis distributed lock

字符流与字节流的区别

.NET深入解析LINQ框架(五:IQueryable、IQueryProvider接口详解)

(三)DDD上下文映射图——老师,我俩可是纯洁的男女关系!

BFM模型和Landmarks可视化

【NOI模拟赛】纸老虎博弈(博弈论SG函数,长链剖分)

【UE虚幻引擎】UE5实现动态导航样条线绘制
随机推荐
Fiddler(二)-手机抓包502错误解决方法
大佬们,mysql里text类型的字段,FlinkCDC需要特殊处理吗 就像处理bigint uns
图的基本概念
Explanation of spark operator
Implementation of redis distributed lock
IDEA引入类报错:“The file size (2.59 MB) exceeds the configured limit (2.56MB)
软件工程国考总结——判断题
MATLAB/Simulink快捷键
【JS 逆向百例】某网站加速乐 Cookie 混淆逆向详解
(三)DDD上下文映射图——老师,我俩可是纯洁的男女关系!
2022-08-02 Analyze RK817 output 32k clock PMIC_32KOUT_WIFI to WiFi module clock register devm_clk_hw_register
【JS 逆向百例】某网站加速乐 Cookie 混淆逆向详解
新特性解读 | MySQL 8.0 在线调整 REDO
研究性学习专题 3_LL(1)语法分析设计原理与实现
layout manager
Yolov5更换主干网络之《旷视轻量化卷积神经网络ShuffleNetv2》
C语言strchr()函数以及strstr()函数的实现
【论文笔记】Delving into the Estimation Shift of Batch Normalization in a Network
金仓数据库的单节点如何转集群?
Quick tips for getting out of a single