Skip to content
Melissa Stock edited this page May 15, 2019 · 1 revision

Understanding Error first Callbacks

  1. The first argument of the callback is reserved for an error object.
  2. The second argument of the callback is reserved for any successful response data

YDKJS

  • JS is broken down into two components: one that runs now and one that runs later
  • Whenever there is an event, the event loop runs until the queue is empty
  • JS can only run one event from the queue at a time
  • Concurrency is when two events interleave over time, given a simultaneous appearance
  • We use callback functions to manage async
  • JS is single threaded however how the thread is compiled (the call stack) is very different then how our brains think
  • Promises are used to help inversion control problems created by callbacks
  • Promises help close the gap between how our brains organize the call stack and how it is actually done by the program

Clone this wiki locally