Everything You Need to Know About Promises, Thenables, & Lazy-Evaluationby@austingil
835 reads

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

tldt arrow
EN
Read on Terminal Reader🖨️

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

@austingil

Austin Gil

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa