Coursera 笔记

Module 02 · Asynchronous I/O with callback programming异步 I/O 与回调编程

Module Summary模块总结

Coursera ↗

Congratulations! You have completed this module. At this point in the course, you know:
恭喜!您已完成本模块。在课程的这个阶段,您已经知道:

  • Asynchronous network operations can be handled using callback functions in order to prevent blocking JavaScript code  
    异步网络操作可以使用回调函数来处理,以防止阻塞 JavaScript 代码
  • A callback function must invoke another callback function to pass a message from the Node.js module back to the main application after the Node.js module receives a response message 
    回调函数必须在 Node.js 模块接收到响应消息后,调用另一个回调函数,将消息从 Node.js 模块传递回主应用程序
  • Nested callbacks can be difficult to read and debug. Inversion of control causes trust issues when dealing with third-party code 
    嵌套回调难以阅读和调试。控制反转在处理第三方代码时会引起信任问题
  • Promise objects are most useful for operations that are time-consuming and can block resources 
    承诺对象对于耗时且可能阻塞资源的操作最有用
  • JSON.parse() and JSON.stringify() are two methods used to parse JSON objects 
    JSON.parse() 和 JSON.stringify() 是两个用于解析 JSON 对象的方法