paint-brush
Everything You Need to Know About Promises, Thenables, & Lazy-Evaluationby@austingil
1,440 reads
1,440 reads

Everything You Need to Know About Promises, Thenables, & Lazy-Evaluation

by Austin Gil5mJanuary 20th, 2023
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

In the new year, I’m going to show you how to make `Promise`s to be more lazy. Let’s look at a basic `Promise’ example. Here, I have a function called sleep that takes a time in milliseconds and a value. It returns a promise that will execute a `setTimeout` for the number of milliseconds that we should wait.
featured image - Everything You Need to Know About Promises, Thenables, & Lazy-Evaluation
Austin Gil HackerNoon profile picture
Austin Gil

Austin Gil

@austingil

I want to help you build better websites. It's fun!

L O A D I N G
. . . comments & more!

About Author

Austin Gil HackerNoon profile picture
Austin Gil@austingil
I want to help you build better websites. It's fun!

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here