console.log([1,2,3,4,5].splice(1,2,3,4,5));
console.log([1,2,3,4,5].slice(1,2,3,4,5));
[2,3]和[2]
<html>
<body>
<div id="root" style="border:1px solid red;">
<div style="width:10px;height:10px;margin:10px;"></div>
<div style="width:10px;height:10px;margin:20px;"></div>
</div>
</body>
</html>
70px
87.5%
parseInt('0x111')
273
客户端会对服务器下发的证书进行域名校验
XSS攻击需要也服务器对接口进行防护
for(var i = 0; i < 10; i++) {
setTimeout(function() {
console.log(i);
}, 1000);
}
10个10
application/json
function Setcount(count){
this.count=count
}
Setcount.prototype.printCount=function(){
console.log(this.count)
}
let a = new Setcount(100)
a.count =200
a.__proto__.count=300
a.__proto__.printCount()
a.printCount()
300,200
z-index属性对元素position属性为relative,absolute, fixed都可以做层级设置
Object.prototype.foo = 'Object';
Function.prototype.foo = 'Function';
function Animal () {};
var cat = new Animal();
console.log(cat.foo);
console.log(Animal.foo);
Object Function
var bar = [1,2,3]; for(var i in bar) {
setTimeout(function(){console.log(bar[i])},0);
console.log(bar[i]);
}
123和333