Results for “then”
Small, practical examples. Search by task or narrow things down below.
Run cleanup after a promise settles
TypeScript: finally runs after success or failure and normally preserves the original outcome.
TypeScript✓ Tested
Run cleanup through a scoped destructor
C++: A stack object’s destructor runs when its scope exits, including normal exception unwinding.
C++✓ Tested
Run dependent async steps in order
TypeScript: Await one result before using it as the input of the next calculation.
TypeScript✓ Tested
Run your first program
TypeScript: Start with a complete program that prints one line. Follow the run instructions below.
TypeScript✓ Tested
Run your first program
C++: Start with a complete program that prints one line. Follow the run instructions below.
C++✓ Tested
Run your first program
C: Start with a complete program that prints one line. Follow the run instructions below.
C✓ Tested
Safely read a caught error
Check the error type before accessing its message.
unknown✓ Tested
Saturate arithmetic at the type boundary
Saturate arithmetic at the type boundary in a complete Rust program using the standard library.
Rust✓ Tested
Scope a component’s styles
Scope a component’s styles with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Search a sorted array with bsearch
C: The search uses the same ordering comparator as the sorted input.
C✓ Tested
Search a sorted slice
Search a sorted slice in a complete Rust program using the standard library.
Rust✓ Tested
Search a sorted vector
Use binary_search after ensuring C++ values are sorted.
C++✓ Tested