前端面试题
前端客户端职业研发
科学研究,不断探索,步步实践
展开
-
TC - front end
1、一个数组 par 中存放有多个人员的信息,每个人员的信息由年龄 age 和姓名 name 组成,如{age: 2, name: ‘xx’}。请写一段 JS 程序,对这个数组按年龄从小到大进行排序。function getAge (arr) { return arr.sort(function(x,y){ return x.age - y.age; }); }...转载 2018-05-31 15:52:17 · 484 阅读 · 0 评论 -
promise、async、await异步原理与执行顺序
async function async1(){ console.log('async1 start'); await async2(); console.log('async1 end');}async function async2(){ console.log('async');}console.log('script start');setTimeout(...原创 2018-06-20 09:46:27 · 3574 阅读 · 5 评论