Results for “or”
Small, practical examples. Search by task or narrow things down below.
Await an asynchronous method result
C#: Use Task<T> for an async operation with a typed result.
C#✓ Tested
Bind a multiline notes field
Bind a multiline notes field with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Bind a numeric input value
Bind a numeric input value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Bind a radio-button group
Bind a radio-button group with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Bind a style property
Bind a style property with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Build an object from key-value entries
JavaScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.
JavaScript✓ Tested
Build an object from key-value entries
TypeScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.
TypeScript✓ Tested
Build text efficiently in a loop
Java: Append to StringBuilder when constructing a string incrementally.
Java✓ Tested
Cache repeated pure function calls
Python: Use lru_cache to avoid recomputing results for identical hashable arguments.
Python✓ Tested
Calculate a fixed-window moving average
C: For this small window, sum each complete group and skip incomplete prefixes.
C✓ Tested
Calculate a least common multiple using a GCD
C: Divide before multiplying to reduce the risk of intermediate overflow.
C✓ Tested
Calculate a product with Aggregate
C#: Supply a seed to define the result for an empty sequence.
C#✓ Tested