FIND YOUR NEXT FEW LINES

Results for “node”

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

258 snippets foundClear filters
JavaScriptNumbers & numeric validation

Clamp a number between inclusive bounds

JavaScript: Combine Math.min and Math.max when lower is no greater than upper.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Clamp a number between inclusive bounds

TypeScript: Combine Math.min and Math.max when lower is no greater than upper.

TypeScript✓ Tested
JavaScriptPromises & iteration protocols

Clean up a generator after an early break

JavaScript: Breaking a for-of loop closes a generator and runs its finally block.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Clean up a generator after an early break

TypeScript: Breaking a for-of loop closes a generator and runs its finally block.

TypeScript✓ Tested
jQueryInsertion & wrapping

Clone markup without sharing its identity

jQuery: clone creates a separate node; change duplicated IDs before inserting.

jQuery✓ Tested
JavaScriptGetting Started

Combine text with a name

JavaScript: Construct a greeting from a fixed prefix and a stored name.

JavaScript✓ Tested
TypeScriptGetting Started

Combine text with a name

TypeScript: Construct a greeting from a fixed prefix and a stored name.

TypeScript✓ Tested
JavaScriptGetting Started

Compare a value with a limit

JavaScript: Turn a comparison into a readable yes or no result.

JavaScript✓ Tested
TypeScriptGetting Started

Compare a value with a limit

TypeScript: Turn a comparison into a readable yes or no result.

TypeScript✓ Tested
JavaScriptNumbers & numeric validation

Compare bounded floating-point results with a tolerance

JavaScript: Use an absolute error threshold for values known to be near one.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Compare bounded floating-point results with a tolerance

TypeScript: Use an absolute error threshold for values known to be near one.

TypeScript✓ Tested
JavaScriptText handling & Unicode

Compare canonically equivalent Unicode text

JavaScript: Normalize to NFC before comparing equivalent composed and decomposed text.

JavaScript✓ Tested