2 3 5 4 1
0 1 2 3 4 5 6 7 8 9
可以看一下这篇文章caibaojian.com/settimeout-…
- 20
- 20
undefined
Uncaught ReferenceError: n is not defined
/preview?projectId=7109486568552792094:6:15 ReferenceError: n is not defined
at bar (https://code.devrank.cn/preview?projectId=7109486568552792094:6:15)
at https://code.devrank.cn/preview?projectId=7109486568552792094:8:1
1 2 4 5 3 6
script start
async1 start
async2 start
promise1
script end
async1 end
promise2
promise3
setTimeout
function foo() {
}
const bar = new foo()
console.log(bar.__proto__) //{}
console.log(bar.__proto__.__proto__) // {}
console.log(bar.__proto__.__proto__.__proto__) // 空
console.log(bar.__proto__.__proto__.__proto__.__proto__) // 报错 Uncaught TypeError: Cannot read properties of null (reading '__proto__')
console.log(foo.prototype) // {}
console.log(foo.prototype.prototype) // undefined
console.log(foo.prototype.prototype.prototype) // 报错 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')