FIND YOUR NEXT FEW LINES

Results for “or”

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

2638 snippets foundClear filters
ReactForms & validation

Track whether a form differs from its initial value

Track whether a form differs from its initial value with a small React component and explicit browser behavior.

React✓ Tested
jQueryCollections & styling

Transform a collection into a plain array

jQuery: map followed by get returns ordinary JavaScript values.

jQuery✓ Tested
jQueryDeferred work & queues

Transform a deferred value with then

jQuery: then returns a new promise with the callback’s result.

jQuery✓ 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
RustGetting Started

Transform a value by shadowing

Transform a value by shadowing in a complete Rust program using the standard library.

Rust✓ Tested
C++Sequence algorithms

Transform a vector into a separate result

C++: Pre-size the output before writing through its iterator.

C++✓ Tested
JavaRecords & reliable control flow

Transform an asynchronous result

Java: Chain thenApply and join a CompletableFuture to retrieve the completed value.

Java✓ Tested
AngularLifecycle & observable data

Transform an observable value

Transform an observable value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
JavaRecords & reliable control flow

Transform an optional value

Java: Use Optional.map and orElse to transform a possibly absent result.

Java✓ Tested
RustErrors & optional values

Transform an optional value

Transform an optional value in a complete Rust program using the standard library.

Rust✓ Tested
JavaScriptArrays

Transform array values

Use map to create a JavaScript array of squared values.

JavaScript✓ Tested