Futures vs. Promises
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Promises
A Promise, on the other hand, is a mechanism to write asynchronous code in a more synchronous fashion. A Promise embodies both the task itself and a way to control its execution, meaning you both initiate the computation and retrieve the eventual result in the same object. Formerly, Promises existed primarily in web development but have since evolved to other languages and libraries.
Example of Promise in JavaScript
Key Differences
Related reading
- Futurevoid async vs simply void async in Dart
- GAE-ready asynchronous operations in Python?
- General query about Callback functions and Threads
- Generator return doesn't work in for-await-of loop
- Generate a Hash from string in Javascript
- Generate SHA-1 for Flutter/React-Native/Android-Native app
- Get a list of all threads currently running in Java
- Get a list of all threads currently running in Java
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseInterview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.