普通函數(shù)this指向該函數(shù)被調(diào)用的對(duì)象;
箭頭函數(shù)指向定義時(shí)this的指向,好處是,避免了this在運(yùn)行時(shí)this指向不確定。
突然想起來(lái):普通函數(shù)有點(diǎn)像css中的“em”,箭頭函數(shù)有點(diǎn)像css中的“rem”。哈哈,我好機(jī)智
箭頭函數(shù)指向定義時(shí)this的指向,好處是,避免了this在運(yùn)行時(shí)this指向不確定。
突然想起來(lái):普通函數(shù)有點(diǎn)像css中的“em”,箭頭函數(shù)有點(diǎn)像css中的“rem”。哈哈,我好機(jī)智
2018-03-22
Failed to load resource: the server responded with a status of 404 (Not Found)
2018-03-22
Object.defineProperty(Person,"sex",{
writeable:false,
value:"male
})
//es5,通過(guò)定義常量的方式,來(lái)保護(hù)數(shù)據(jù)
writeable:false,
value:"male
})
//es5,通過(guò)定義常量的方式,來(lái)保護(hù)數(shù)據(jù)
2018-03-19
var params = ["hello",true,7];
var other = [1,2,...params];
console.log(other);//1,2,"hello",true,7
var other = [1,2,...params];
console.log(other);//1,2,"hello",true,7
2018-03-19