Syntax - Tasty Web Development Treats cover image

Syntax - Tasty Web Development Treats

765: JS Promises Fundamentals - Part 1

May 6, 2024
22:01
Snipd AI
Unravel the concept of JavaScript promises with common examples like fetch calls, database queries, and user permissions. Dive into creating and waiting on promises, resolving/rejecting them, and using async functions. Compare dot then and async await for handling promises effectively.
Read more

Podcast summary created with Snipd AI

Quick takeaways

  • Promises in JavaScript act as IOUs for future data completion, with examples like fetch calls and database queries showcasing their utility.
  • Creating promises involves methods like 'new Promise', 'promise.withresolvers', and marking functions as async for automatic promise return.

Deep dives

Introduction to Promises: Understanding the Basics

In this episode, the hosts introduce the concept of promises in JavaScript, highlighting the difference between a regular variable/function and a promise as an IOU for future data completion. Promises are described as a commitment to return data in the future, whether successfully (resolved) or in case of failure (rejected). Examples such as fetch calls, database queries, and user permission requests are used to illustrate the usefulness of promises.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode