FIND YOUR NEXT FEW LINES

Results for “type checking”

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

226 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
TypeScriptUtilities & async

Select fields with the Pick utility type

Expose a smaller view of a larger object type.

Pick✓ 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
TypeScriptUtilities & async

Type an object update with Partial

Allow a caller to provide just the fields to change.

Partial✓ Tested
C++Containers & compound values

Use a fixed-size container with bounds checking

C++: std::array retains its element count and supports checked access through at.

C++✓ 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