浏览器的重排和重绘

news/2024/7/10 22:36:27 标签: javascript, 前端, es6

重排

在这里插入图片描述

重绘

在这里插入图片描述
在这里插入图片描述
这些可以提高性能
在这里插入图片描述
在这里插入图片描述


http://www.niftyadmin.cn/n/1371666.html

相关文章

generator函数

<script>function* a(){console.log("第一段");yield console.log("第二段");yieldconsole.log("第三段");}const ba()const cb.next()const db.next()const eb.next()// console.log(c); </script>

for of 循环

function* a(){console.log("第一段");yield "111"console.log("第二段");yield "222"console.log("第三段");}const ba() for(let value of b){console.log(value); }

Set数据结构

add <script> const snew Set(["夕阳","西下","断肠人"]) s.add("在天涯") console.log(s); </script>delete const snew Set(["夕阳","西下","断肠人"]) s.delete("断肠人") …

map数据结构

看下面的面试题 我们不能自定义数组里面的key map数据结构就解决了这一问题&#xff0c;map可以自定义数组的key set <script> const mnew Map([["name","aa"],["age",18],["name:a","age:b"] ]) m.set([function()…

js高级 事件轮询

一个简单代码的工作流程

Object.defineProperty理解

数据劫持&#xff0c;指的是在访问或者修改对象的某个属性时&#xff0c;通过一段代码拦截这个行为&#xff0c;进行额外的操作或者修改返回结果。 vue使用的数据劫持用的是Object.defineProperty enumerable 当且仅当该属性的 enumerable 键值为 true 时&#xff0c;该属性…

函数,构造函数中使用call,apply,bind 以及他们的区别

函数中使用 bind function eat(food,name){this.foodfoodthis.callcall } function weather(food,name,what){console.log("今天的天气是"what);console.log("我喜欢吃"food);console.log("我是"name) } weather.bind(eat,"肉",&quo…

伪数组 伪数组怎样使用数组里面的方法

伪数组 伪数组它的类型不是Array&#xff0c;而是Object&#xff0c;而数组类型是Array。可以使用的length属性查看长度&#xff0c;也可以使用[index]获取某个元素&#xff0c;但是不能使用数组的其他方法&#xff0c;也不能改变长度&#xff0c;遍历使用for in方法。 伪数组…