meathill-lecture / promise-yes Goto Github PK
View Code? Open in Web Editor NEWSlide about how to use Promise in JavaScript.
Home Page: https://meathill-lecture.github.io/promise-yes
Slide about how to use Promise in JavaScript.
Home Page: https://meathill-lecture.github.io/promise-yes
问题1:
因为回调函数和启动函数不在一个栈里,所以 try/catch
无法捕获到回调函数抛出的错误。于是回调函数只能用 callback(err)
的形式将错误反馈给启动函数。
问题2:
在外层作用域声明的变量,可能被其它函数访问和修改,造成错误。所以一般来说我们推荐哪里使用哪里声明。但是由于我们不清楚这些异步操作的完成顺序,只能在外层作用域声明变量。
问题3:
只有上面两个问题,没有标称的4个问题。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.