![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JS工具模块
依轩cc
这个作者很懒,什么都没留下…
展开
-
【eslint】配置保存自动格式化
ide:vscode转载 2022-09-11 17:15:21 · 513 阅读 · 0 评论 -
npm 发布 自己编写的库(以大数加法为例,完整流程)
步骤以大数加法为例:创建项目,安装 webpack, webpack-climkdir npm_publish_bigIntcd npm_publish_bigIntnpm init -ycnpm i webpack -Dcnpm i webpack-cli -Dcnpm i terser-webpack-plugin -D编写库的源码// src/index.jsexport default function add (a,b) { let aLen =原创 2022-05-04 21:00:51 · 255 阅读 · 0 评论 -
前端常用正则表达式
规则/ $/ 结束^ 以 开头\d 数字?可以不存在js用法// test, 返回Boolean/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test('#FFF') // true// replace'11#FFF11#FFFFFF'.replace(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/g,'替换后') // '11替换后11替换后'// match, 返回Array`"The rain in SPAIN stays ma原创 2022-03-12 23:05:16 · 1104 阅读 · 0 评论 -
JS工具函数——(searchProperty,clone,getChildren)
/* 查询对象、数组的属性或方法,返回其路径 使用场景:已知属性名且唯一,查找API,返回其路径*/let arr = [];function searchProperty(obj,count,res) { if(count > 8) { // 迭代次数 return 0 } count++ if(obj instanceof Array) { // 数组 let len = Math.min(obj.length,5) // 只找前五个 for(let i=0;原创 2021-07-21 09:36:41 · 327 阅读 · 0 评论