小小考题
- 聊聊闭包,单例,模块化这些概念以及他们之间的联系
- 第二题
// 排序
var a = [
{ idx: 20, otherInfo: {} },
{ idx: 3, otherInfo: {} },
{ idx: 0, otherInfo: {} },
{ idx: 11, otherInfo: {} },
{ idx: 78, otherInfo: {} },
{ idx: 12, otherInfo: {} },
{ idx: 40, otherInfo: {} },
{ idx: 7, otherInfo: {} }
];
布局
不使用fixed/absolute,让某一个块元素一直置于最底部,中间列表可以滚动,顶部title栏一直吸顶聊一聊数组方法中的length,如果让你来实现该属性,你觉得应该如何处理它,怎么样的方式性能比较优?
实现一个MyMath对象,它继承所有的Math的方法,并重写random方法,MyMath的random方法返回(0, 9]的随机整数。
function MyMath() {}
...
var m = new MyMath();
m.random(); // 返回 (0, 9]的随机整数
m.max(1, 2, 3); // 3
m.PI; // 3.14159...
// 等等其他方法与Math完全一致
实现一个搜索框的功能,要求当输入的内容改变时就去请求一次提示接口,当输入过快时,如何控制接口请求的频率。
聊一聊call/apply/bind的作用与区别,以及箭头函数能否取代bind?为什么
下列代码的输出顺序,说说为什么会这样执行
console.log(1);
setTimeout(() => {
console.log(2);
}, 0);
console.log(3);
var p = new Promise((resolve) => {
console.log(4);
resolve(5);
})
p.then(re => {
console.log(re);
setTimeout(() => {
console.log(6)
})
}, 0);
console.log(7);
写一个方法获取window.location.search中的参数值
目前准备学习的新知识以及选择学习它的原因/方式、觉得自己多久能学会
对团队合作能力的理解与实践