JS知识点

new 这么一个东西,在 js 中到底是 做了哪些事情。简单来讲 js 在new 的过程中只做了三件事

1.创建一个新对象

2.将这个新对象的 proto 指向构造函数的prototype

3.成员对象将构造函数的 this 指针 指向 这个新创建的对象

DOM知识点

document.defaultView.getComputedStyle(element) 获取dom元素的样式信息

element.getBoundingClientRect() 获取元素在屏幕中的定位信息

BOM

window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth

window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight

你可能感兴趣的:(JS知识点)