Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Workshop

This workshop contains quiz questions and exercises to help cement your learning in this hour.

Quiz

1. How is programming around events different?

2. Why are events a good approach for network programming?

3. Why is JavaScript a good fit for the problems that Node.js is trying to solve?

Quiz Answers

1. When you use events, your scripts are no longer executed in the order that they are written in, as is the case with simple sequential scripts. Instead, event listeners are used to respond to events that occur, regardless of when they happen. This is liberating but initially requires a change in thinking about how you approach your code.

2. When your application includes network calls, you are often unable to predict exactly when something will return. As applications become more complex, it becomes much more manageable and efficient to structure code around events. When an event happens, a listener can respond to it!


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial