
js相关
qzhcode
这个作者很懒,什么都没留下…
展开
-
js 数组去重的方法
数组去重原创 2022-08-29 09:47:42 · 108 阅读 · 0 评论 -
vite项目跨域的简单配置
vue项目跨域配置原创 2022-07-12 10:44:31 · 1422 阅读 · 0 评论 -
替代Math.random()方案
替换Math.random()不安全漏洞原创 2022-07-08 16:06:11 · 2405 阅读 · 0 评论 -
Video标签控制是否允许快进
video标签控制是否允快进原创 2022-07-01 15:04:56 · 556 阅读 · 0 评论 -
数组乱序的方法
function shuffle (arr) { let i = arr.length; while (i) { let j = Math.floor(Math.random() * i--); [arr[j], arr[i]] = [arr[i], arr[j]]; } return arr; }原创 2022-04-23 10:53:30 · 235 阅读 · 0 评论 -
简述js中的变量提升和函数提升
简述js中的变量提升和函数提升 先看代码 var foo = function () { console.log('foo1'); } foo(); // foo1 var foo = function () console.log('foo2'); } foo(); // foo2 function foo() { console.log('foo1'); } foo(); // foo2 function foo() { console.log('foo2'); }原创 2022-02-28 11:38:06 · 528 阅读 · 0 评论 -
js 操作全屏切换的方法
js 操作全屏切换的方法 // Vue项目中全屏按钮的点击事件 launchFullScreen() { const isFullScreen = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement if (!isFullScreen) { if (document.body.requestFullscreen) {原创 2022-02-18 09:16:51 · 716 阅读 · 0 评论 -
js执行机制
除了广义的同步任务和异步任务,我们对任务有更精细的定义: macro-task(宏任务):包括整体代码script,setTimeout,setInterval micro-task(微任务):Promise,process.nextTick 我们来分析一段较复杂的代码 console.log('1'); setTimeout(function () { console.log('2'); process.nextTick(function () { console.log('3');原创 2021-05-03 21:20:11 · 72 阅读 · 0 评论