Asynchronous JavaScript

Save time by executing code over time. Doesn’t take a long time!

It’s hard to imagine a website that never sends any messages to analytics, 3rd party APIs, or to databases where important information like user profile information and chat history are held.

What you’ll learn

  • Delay code execution with setTimeout.
  • Repeatedly perform tasks with SetInterval.
  • Wrap asynchronous code in Promises.
  • Understand and Use Async / Await.
  • Understand and Use Generators.

Course Content

  • Introduction to Asynchronous JavaScript –> 5 lectures • 22min.
  • setTimeout and setInterval –> 5 lectures • 25min.
  • Async / Await –> 5 lectures • 24min.
  • Generator Functions –> 3 lectures • 12min.

Asynchronous JavaScript

Requirements

  • Beginner-Level JavaScript.

It’s hard to imagine a website that never sends any messages to analytics, 3rd party APIs, or to databases where important information like user profile information and chat history are held.

Consider the following scenario:

You are the in-house developer at W&W Window Washers.

The owner’s eccentric son, Malachi Window, appears at your desk one afternoon in a flush.

“We’ve signed up with a new payment platform, one that will be less inclined to pry into our… affairs.” He says.

“Right,” you agree, with some hesitation.

“You need to update our website to go through that vendor. Send the client’s payment information to the vendor, and when the vendor’s API sends a message back, send the order to our supplier,” explains Malachi.

You fire up your computer and get to work, but
there’s a problem.

JavaScript code executes all at once. There is no wait keyword in JavaScript that pauses before the next line of code. So how can we know if the payment information is approved by the vendor before sending a message to the supplier?

Did you know that none of these things can be accessed in JavaScript without Asynchronous Code?

In this course, we’ll cover the 5 primary tools all developers need to write asynchronous JavaScript:

  • setTimeout
  • setInterval
  • Promise
  • async / await
  • Generator Functions

By the end of this course, you should feel comfortable using all these tools in projects, and you should be able to decide which tool makes the most sense for any given project.

 

“Either write something worth reading or do something worth writing.”

Benjamin Franklin

 

“If we all did the things we are really capable of doing, we would literally astound ourselves.”

“Genius is one percent inspiration, ninety-nine percent perspiration.”

“We often miss opportunity because it’s dressed in overalls and looks like work”

Thomas A. Edison

 

“If you can’t explain it to a six year old, you don’t understand it yourself.”

“Anyone who has never made a mistake has never tried anything new.”

“Logic will get you from A to Z; imagination will get you everywhere.”

“Any fool can know. The point is to understand.”

Albert Einstein

Get Tutorial