Promise面试题(持续更新~)
Promise面试题
几道打印的基础题
题1
const promise = new Promise((resolve, reject) => { |
1 2 4 3
题2
const promise1 = new Promise((resolve, reject) => { |
题3
const fn = () => (new Promise((resolve, reject) => { |
1
2
success
题4
const fn = () => (new Promise((resolve, reject) => { |
2
1
success
Promise结合setTimeout
题1
console.log(1) |
1 4 3 2
题2
const promise = new Promise((resolve, reject) => { |
1 4 5 2 3 success
题3
Promise.resolve().then(() => { |
5 1 3 4 2
题4
const promise1 = new Promise((resolve, reject) => { |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Hillyee-blog!
评论