FIND YOUR NEXT FEW LINES

Results for “or”

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

2638 snippets foundClear filters
TypeScriptObject behavior & collections

Find members absent from another set

TypeScript: Negate a membership test to calculate the set difference.

TypeScript✓ Tested
JavaScriptObject behavior & collections

Find shared members of two sets

JavaScript: Filter one set through the other set’s membership test.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Find shared members of two sets

TypeScript: Filter one set through the other set’s membership test.

TypeScript✓ Tested
JavaStream transformations

Find the first matching stream value

Java: Use findFirst and an explicit default for an empty result.

Java✓ Tested
RustIterators & transformations

Find the first matching value

Find the first matching value in a complete Rust program using the standard library.

Rust✓ Tested
C++Sequence algorithms

Find the first value satisfying a condition

C++: Compare the returned iterator with end before dereferencing it.

C++✓ Tested
CArray transformations

Find the smallest value in a nonempty array

C: Initialize from the first element instead of assuming a numeric sentinel.

C✓ Tested
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested
RustIterators & transformations

Flatten nested collections

Flatten nested collections in a complete Rust program using the standard library.

Rust✓ Tested
C#LINQ transformations

Flatten nested collections with SelectMany

C#: Concatenate the items from several sequences into one sequence.

C#✓ Tested
CSmall algorithms & bit operations

Generate a bounded Fibonacci sequence

C: Keep only the two previous values instead of using exponential recursive calls.

C✓ Tested
Arduino / CArrays & embedded state

Group related readings in a struct

Arduino / C: A struct keeps a sample’s fields together without dynamic allocation.

Arduino / C✓ Tested