FIND YOUR NEXT FEW LINES

Results for “types”

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

163 snippets foundClear filters
TypeScriptGetting Started

Visit every item in a collection

TypeScript: Print each element in the collection’s original order.

TypeScript✓ 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
C#Types & reliable control flow

Write a generic first-or-fallback helper

C#: Constrain a generic helper through its input shape and return an explicit caller-supplied fallback.

C#✓ Tested
GoFunctions & types

Write a generic slice helper

Write a generic slice helper using a complete Go program with explicit sample inputs.

Go✓ Tested
TypeScriptUtilities & async

Await several independent results

Preserve input order while awaiting multiple promises.

Promise.all✓ Tested
PowerShellDates & numeric validation

Compute beyond the fixed-width integer range

PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.

PowerShell✓ Tested
TypeScriptCollections & records

Count words using a Map

Update a keyed counter without losing its value type.

Map✓ Tested
SQLGetting Started

Create a table and insert its first row

SQL: Define column types and a primary key, then insert one row using an explicit column list.

SQL✓ Tested
SQL ServerGetting Started

Create a table and insert its first row

SQL Server: Define column types and a primary key, then insert one row using an explicit column list.

SQL Server✓ Tested
PostgresGetting Started

Create a table and insert its first row

Postgres: Define column types and a primary key, then insert one row using an explicit column list.

Postgres✓ Tested
SQLiteGetting Started

Create a table and insert its first row

SQLite: Define column types and a primary key, then insert one row using an explicit column list.

SQLite✓ Tested
TypeScriptTypes & functions

Describe an object with an interface

Require named fields on a reusable object shape.

interface✓ Tested