Results for “Promise.all”
Small, practical examples. Search by task or narrow things down below.
Observe when a DOM node is attached
Observe when a DOM node is attached with a small React component and explicit browser behavior.
React✓ Tested
Perform cleanup even after an exception
C#: A finally block runs after a handled failure as well as after success.
C#✓ Tested
Produce a lazy sequence with a generator
JavaScript: A generator yields one value per iteration without building an intermediate array.
JavaScript✓ Tested
Produce a lazy sequence with a generator
TypeScript: A generator yields one value per iteration without building an intermediate array.
TypeScript✓ Tested
Remove matching items from a mutable list
C#: List.RemoveAll returns how many items it removed.
C#✓ Tested
Require every bit in a mask
Arduino / C: Masking followed by equality tests whether all required flags are set.
Arduino / C✓ Tested
Return typed data from an async function
Await a Promise and handle failures explicitly.
async✓ Tested
Run cleanup after a caught exception
PowerShell: Use finally for cleanup that must occur after either success or failure.
PowerShell✓ Tested
Run cleanup after a handled exception
Java: A finally block executes whether the protected operation succeeds or fails.
Java✓ Tested
Run dependent async steps in order
JavaScript: Await one result before using it as the input of the next calculation.
JavaScript✓ Tested
Run dependent async steps in order
TypeScript: Await one result before using it as the input of the next calculation.
TypeScript✓ Tested
Sum the decimal digits of an unsigned integer
C: Repeated division and remainder extract digits without converting to text.
C✓ Tested