检测当前引擎是否支持u修饰符
1 | function hasRegExpU(){ |
1 | function hasRegExpU(){ |
八月 18日, 2020
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263...
一月 9日, 2020
没有指定范围生成 Math.floor(Math.random()*Number) 从0开始到Number,但不包含Number指定范围随机数的生成 Math.floor(Math.random()*(max-min+1)+min) ...
一月 2日, 2020
1 防抖 debouncedebounce防抖 :在事件被触发n秒后执行,如果在此时间再次触发事件,则重新开始计时。例如联想搜索 html1<input type="text" id="phone"> js1234567...
十二月 19日, 2019
所有计算机编程语言里浮点数计算会存在精度丢失问题(或称舍入误差),其根本原因是二进制和实现位数限制有些数无法有限表示在我的前端工作中,整数的运算很少出现精度损失的问题,除非超过Math.pow(2,53)的超大整数,但是在电商项目中,...
五月 10日, 2020
const randomHexColorCode => () { let n = (Math.random() * 0xfffff * 1000000).toString(16); ret...
四月 23日, 2020
1. set方法去重123function unique(){ return Array.from(new Set(this))} 1234567const arr =[]for (let i = 0; i ...
四月 10日, 2020
自定义bind和call及apply重要的是this和参数```bash js// 设置公共this方法let pubContext = funtion(){return this} Function.prototype._bind ...
四月 4日, 2020
css处理全网灰暗css12345678filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms...
三月 23日, 2020
验证邮政编码1234/** * @param { string } value */export const isPostcode = value => /^(0[1-7]|1[0-356]|2[0-7]|3...
三月 23日, 2020
观察者模式和发布订阅模式观察者模式:是指一个对象(subject)维持一个依赖列表Observer,当主题状态发生变化的时候,会通知观察者集合。发布和观察者都能看到对方都知道对方的存在。比如事件触发。发布订阅模式:观察者和订阅者关联。...