Results for “types”
Small, practical examples. Search by task or narrow things down below.
Visit every item in a collection
TypeScript: Print each element in the collection’s original order.
TypeScript✓ Tested
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
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
Write a generic slice helper
Write a generic slice helper using a complete Go program with explicit sample inputs.
Go✓ Tested
Await several independent results
Preserve input order while awaiting multiple promises.
Promise.all✓ Tested
Compute beyond the fixed-width integer range
PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.
PowerShell✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
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
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
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
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
Describe an object with an interface
Require named fields on a reusable object shape.
interface✓ Tested