<a>
标签平常用来做什么localStorage
和sessionStorage
cookie
实现广告在某个时间段投放,到时就过期for(var i = 0; i < 5; i++) { setTimeout(() => { console.log(i) }, 1000) }
console.log("script start"); const promiseA = new Promise((resolve, reject) => { console.log("init promiseA"); resolve("promiseA"); }); const promiseB = new Promise((resolve, reject) => { console.log("init promiseB"); resolve("promiseB"); }); setTimeout(() => { console.log("setTimeout run"); promiseB.then(res => { console.log("promiseB res :>> ", res); }); console.log("setTimeout end"); }, 500); promiseA.then(res => { console.log("promiseA res :>> ", res); }); console.log("script end");
setup
的理解判断版本请补全JavaScript代码,该函数接收两个参数分别为旧版本、新版本,当新版本高于旧版本时表明需要更新,返回true,否则返回false。注意:
- 版本号格式均为"X.X.X"
- X∈[0,9]
- 当两个版本号相同时,不需要更新
面试官是个小姐姐,面试氛围很好,问的也很基础
#面经##网易##网易有道#