FIND YOUR NEXT FEW LINES

Results for “Promises & iteration protocols”

Small, practical examples. Search by task or narrow things down below.

57 snippets foundClear filters
JavaScriptPromises & iteration protocols

Run cleanup after a promise settles

JavaScript: finally runs after success or failure and normally preserves the original outcome.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Run cleanup after a promise settles

TypeScript: finally runs after success or failure and normally preserves the original outcome.

TypeScript✓ Tested
JavaScriptPromises & iteration protocols

Run dependent async steps in order

JavaScript: Await one result before using it as the input of the next calculation.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Run dependent async steps in order

TypeScript: Await one result before using it as the input of the next calculation.

TypeScript✓ Tested
JavaScriptPromises & iteration protocols

Transform a resolved promise result

JavaScript: A then handler returns the value passed to the next promise in the chain.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Transform a resolved promise result

TypeScript: A then handler returns the value passed to the next promise in the chain.

TypeScript✓ Tested
JavaScriptPromises & iteration protocols

Use the first fulfilled promise result

JavaScript: Promise.any ignores individual rejections until one input fulfills.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Use the first fulfilled promise result

TypeScript: Promise.any ignores individual rejections until one input fulfills.

TypeScript✓ Tested
Bash ScriptsArguments & decisions

Skip selected iterations in a loop

Bash Scripts: Continue starts the next iteration without running the remaining loop body.

Bash Scripts✓ Tested
JavaScriptFiles & async

Wait for multiple promises

Use Promise.all to collect JavaScript results in input order.

JavaScript✓ Tested
PythonIteration & sequences

Calculate cumulative totals

Python: Use accumulate to retain the running sum after each input.

Python✓ Tested
Arduino / CSerial protocols

Convert received ASCII letters to uppercase

Arduino / C: ctype functions should receive an unsigned character value.

Arduino / C✓ Tested