Results for “Functions & data types”
Small, practical examples. Search by task or narrow things down below.
Find values missing from another collection
C#: Except removes duplicates as it calculates the set difference.
C#✓ Tested
Find what remains after division
TypeScript: Use the remainder operator to count items left after forming complete groups.
TypeScript✓ Tested
Flatten a single nesting level
TypeScript: flat defaults to a depth of one and creates a new array.
TypeScript✓ Tested
Format an integer as padded hexadecimal
Format an integer as padded hexadecimal in a complete Rust program using the standard library.
Rust✓ Tested
Format whole seconds as hours minutes and seconds
TypeScript: Use integer divisions and remainders for a nonnegative duration.
TypeScript✓ Tested
Generate a bounded integer range
TypeScript: Array.from supplies each output position to its mapping function.
TypeScript✓ Tested
Generate every combination of two sets
SQL: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQL✓ Tested
Generate every combination of two sets
SQL Server: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQL Server✓ Tested
Generate every combination of two sets
Postgres: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
Postgres✓ Tested
Generate every combination of two sets
SQLite: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQLite✓ Tested
Give a document a descriptive browser title
HTML: The title element supplies the browser document title independently of the visible heading.
HTML✓ Tested
Group records into map entries
TypeScript: Initialize an array for a missing Map key before appending its values.
TypeScript✓ Tested