FIND YOUR NEXT FEW LINES

Results for “utility type”

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

219 snippets foundClear filters
jQueryGetting Started

Respond while a user types

jQuery: Learn how to respond while a user types in a complete browser example.

jQuery✓ Tested
TypeScriptUtilities & async

Return typed data from an async function

Await a Promise and handle failures explicitly.

async✓ Tested
RustNumbers & durations

Saturate arithmetic at the type boundary

Saturate arithmetic at the type boundary in a complete Rust program using the standard library.

Rust✓ Tested
TypeScriptCollections & records

Sum typed values with reduce

Accumulate numeric array elements.

reduce✓ Tested
SQL ServerJSON & results

Turn JSON into typed rows

Project JSON array items into SQL columns.

OPENJSON✓ Tested
TypeScriptCollections & records

Type a dictionary with Record

Limit a lookup table to a known set of keys.

Record✓ Tested
TypeScriptTypes & functions

Type a function’s inputs and output

Catch mismatched arguments during compilation.

function✓ Tested
TypeScriptUtilities & async

Type an object update with Partial

Allow a caller to provide just the fields to change.

Partial✓ Tested
Arduino / CGetting Started

Use a wider type for a large count

Arduino / C: Use a wider type for a large count on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
TypeScriptSafe data handling

Validate an unknown value with a type guard

Check a field before treating unknown data as a typed object.

unknown✓ Tested
RustFunctions & data types

Wrap a value in a distinct type

Wrap a value in a distinct type in a complete Rust program using the standard library.

Rust✓ Tested
JavaEncoding & structured values

Write and read typed binary fields

Java: Data streams use a matching write/read order and fixed encodings for Java primitive values.

Java✓ Tested