http://store.company.com/dir/page.html
http://store.company.com/dir2/other.htm
DOMContentLoaded事件比load事件更早执行
<div></div>
document.querySelector(‘div’).innerText = “
”
div i h2 li
<div class="box box1 box2" style="color:#222">hello</div>,
.box{
color:#999;
}
.box{
color:#333 !important;
}
.box2{
color:#666
}
#333
auto
:center
2^32-1
[true, true]
[1, NaN, NaN]
let a = { c:1 }
let b = a
a = 1
b.c = 2
a.c = (?)
undefined
console.log(1);
setTimeout(() => {console.log(2)}, 0);
console.log(3);
Promise.resolve(4).then(b => {
console.log(b);
});
console.log(5);
1 3 5 4 2
6.666
‘bilibili’.replace(/b/g, ‘B’)
[1,2,3,4,5].slice(1, -1)
function setname(name){
this.name = name
}
setname.prototype.printName = function(){ console.log(this.name) }
let a = new setname("cc")
a.name = "dd"
a.__proto__.name = "ee"
a.__proto__.printName() // ?
a.printName() // ?
ee dd
const players = [ {name: 'UZI', team: 'RNG', position: 'ADC'},
{name: 'theshy', team: 'IG', position: 'TOP'},
{name: 'Metoer', team: 'BLG', position: 'Jungle'},
{name: 'ADD', team: 'BLG', position: 'TOP'},
{name: 'Scout', team: 'EDG', position: 'Middle'},
{name: 'iBoy', team: 'EDG', position: 'ADC'},
{name: 'Baolan', team: 'IG', position: 'Support'},
{name: 'Xiaohu', team: 'RNG', position: 'Middle'}]
players.filter(x=> x.position === ‘TOP’ && x.team === ‘BLG’)