FIND YOUR NEXT FEW LINES

Results for “Types & reliable control flow”

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

308 snippets foundClear filters
CSSResponsive design

Scroll wide code locally

Keep long code inside a horizontally scrollable CSS container.

CSS✓ Tested
TypeScriptArray traversal & selection

Separate a first item from the remaining items

TypeScript: Array destructuring and a rest element produce named pieces of a sequence.

TypeScript✓ Tested
CSSType & reading flow

Separate an underline from the text

CSS: Text-underline-offset improves the gap between letters and a decorative underline.

CSS✓ Tested
CSSType & reading flow

Set an explicit font weight

CSS: Numeric font weights express typographic emphasis independently of a specific font family.

CSS✓ Tested
CSSBox dimensions & overflow

Size a child relative to its containing block

CSS: A percentage width is based on the containing block’s available width.

CSS✓ Tested
CSSBox dimensions & overflow

Size a panel relative to viewport height

CSS: Viewport height units track the browser viewport rather than the parent element.

CSS✓ Tested
TypeScriptUTC date operations

Sort timestamp strings by their parsed instants

TypeScript: Compare epoch values explicitly when date strings may contain different offsets.

TypeScript✓ Tested
TypeScriptArray restructuring

Split an array into bounded batches

TypeScript: Advance by a positive batch size and allow a shorter final chunk.

TypeScript✓ Tested
TypeScriptRegular expressions & URL encoding

Split text on several separator characters

TypeScript: A regex character class can recognize alternative simple delimiters.

TypeScript✓ Tested
jQueryEvent control

Stop a child event from reaching its parent

jQuery: stopPropagation leaves other handlers on the same element intact.

jQuery✓ Tested
TypeScriptGetting Started

Store a value in a named variable

TypeScript: Give a value a descriptive name and print it.

TypeScript✓ Tested
RustFunctions & data types

Store data in an enum variant

Store data in an enum variant in a complete Rust program using the standard library.

Rust✓ Tested