网易前端一面
写面经,攒人品。。
1. 实现一个九宫格布局(不知宽高的情况),手撸实现
2. JS的数据类型
3. JS的数据类型判断方式 typeof、Object.prototype.toString.call()、instanceof的异同
4. 闭包,闭包为什么会导致作用域链不释放
5. 用JS实现Stack与Queue
6. 题目:实现为一组元素添加点击事件,获得每一个元素的UID(涉及DOM操作中的getElementByclassName、addEventListener与onClick的比较选择,以及getAttribute的使用)
7. 介绍Promise
8. 异步相关的输出判断
var p1 = new Promise((resolve, reject) => { console.log(2); setTimeout(() => { console.log(3); resolve('x') console.log(4); }, 0) }) p1.then(x => console.log(1)) // 2 3 4 1