2021/9/28 小红书前端二面
1.说下HTTP的缓存机制
2.了解Map吗,和对象有啥区别,WeakMap知道吗
3.说下浏览器渲染原理。知道如何让<script>不阻塞吗?defer和async有啥区别?defer是在DOMContentLoaded前还是后呢?
4.JS基本数据类型
5.判断打印输出
async function async1(){ console.log('1'); await async2(); await async3(); console.log('2') } async function async2(){ console.log('3') } async function async3(){ console.log('4') } console.log('5'); setTimeout(function(){ console.log('6') },0); async1(); new Promise(function(resolve){ console.log('7'); resolve(); }).then(function(){ console.log('8') }); console.log('9')
6.写一个new的过程
7.根据id访问所在城市的所有路径
const cityData = [{ id: 'axzx', name: '广东省', children: [ { id: 'sdsd', name: '深圳市', children: [ { id: '45dss', name: '南山区' }, { id: 'sdsd11', name: '福田区', children: [{ id: 'ddrr2', name: 'A街道' }] } ] }, { id: '2323d', name: '东莞市', children: [ { id: 'xxs2', name: 'A区' }, { id: 'kklio2', name: 'B区', } ] } ] }];#小红书##面试题目#