摘要: ###总结:then中的代码是同步执行的即使是链式调用也是如此。但then中的回调函数一定要等待前面返回promise结果才能执行。 const a = new Promise((resolve, reject) => { console.log(2); }).then(function x() { 阅读全文
posted @ 2020-11-17 20:52 17135131xjt 阅读(66) 评论(0) 推荐(0) 编辑
摘要: <script> var x = 0 Object.defineProperty(this, 'a', { get() { x++ console.log('get'); return x } }) console.log(a 1 && a 2 && a 3); var obj = { } Obje 阅读全文
posted @ 2020-11-17 10:30 17135131xjt 阅读(59) 评论(0) 推荐(0) 编辑