- Promise输出题
js
let p0 = new Promise((resolve,reject)=>{
reject(1);
});
const thenAble = {
then:(resolve, reject) => {
return p0.then(resolve, reject).catch(error=>{
console.log('err1:' + error);
})
}
}
Promise.resolve(thenAble).catch(error=>{
console.log('err2:' + error);
})
- HTML题目
html
<style>
h1#title { color: red; }
h1.title { color: blue; }
#container .title { font-size: 14px; }
#container h1 { font-size: 20px; }
</style>
<div id="container" class="wrapper">
<h1 id="title" class="title">字节跳动</h1>
</div>