秋招笔试碰到的疑难题目2
|
10、em px,rem 之间的区别 em是相对于父元素的放大倍数; px是固定的,也就是平时我们所说的像素 ?rem是相对于html根元素的,也是放大倍数 pt是1/72英寸,换算公式是px = pt * DPI / 72; 9、一道选择题 var x=foo();//TypeError: foo is not a function
var foo=function () {
return 2;
};
console.log(x);
? 8、一种未见过的new的写法 var a= (){
this.b=1;
};
var b=new a().b;
console.log(b);1
? 7、如何自己写一个bind函数,让其他函数来调用 var a=0;
var f= (b){
return this.a+b;
}
var bbb={"a":1};
Function.prototype.mybind=(obj,num){
var that=this;
(){
return that.call(obj,num);
}
}
var s=f.mybind(bbb,4);
console.log(s())5
? 6、修改背景色的方法 <body background=""><body background-color=""> 上面哪一个是对的。 都不对 正确的是下面这个 <body bgcolor="red"> bgcolor 属性规定文档的背景颜色。不过现在不建议使用 ? 5、AMD的模块命名规范是CommonJS模块名规范的超集。引用如下:
相对模块名解析示例:
? 4、cookie的获取与set ? 3、session?? localStorage 和 sessionStorage之间的区别 ? 2、Cache Control和expires 与last-Modified 和 Etag之间的区别 ? 1、http2.0和http1.1之间的区别
(编辑:清远站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |



