Skip to content

Instantly share code, notes, and snippets.

View IMdmp's full-sized avatar
🎯
Focusing

Dominic Pagtalunan IMdmp

🎯
Focusing
View GitHub Profile
@IMdmp
IMdmp / protips.js
Created November 1, 2025 03:20 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");