An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
Some of Our Sources
View All Sources
October 9, 2021 03:44 pm GMT
Code to promisify
Original Link: https://dev.to/sakethkowtha/promisify-settimeout-2knn
Promisify setTimeout
Code to promisify setTimeout
const delay = (time) => new Promise((resolve, reject) => setTimeout(resolve, time))
Usage
delay(2000).then(() => console.log('Hello i will get logged after 2 second(s)'))
Original Link: https://dev.to/sakethkowtha/promisify-settimeout-2knn
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To