Results for “node”
Small, practical examples. Search by task or narrow things down below.
Clamp a number between inclusive bounds
JavaScript: Combine Math.min and Math.max when lower is no greater than upper.
JavaScript✓ Tested
Clamp a number between inclusive bounds
TypeScript: Combine Math.min and Math.max when lower is no greater than upper.
TypeScript✓ Tested
Clean up a generator after an early break
JavaScript: Breaking a for-of loop closes a generator and runs its finally block.
JavaScript✓ Tested
Clean up a generator after an early break
TypeScript: Breaking a for-of loop closes a generator and runs its finally block.
TypeScript✓ Tested
Clone markup without sharing its identity
jQuery: clone creates a separate node; change duplicated IDs before inserting.
jQuery✓ Tested
Combine text with a name
JavaScript: Construct a greeting from a fixed prefix and a stored name.
JavaScript✓ Tested
Combine text with a name
TypeScript: Construct a greeting from a fixed prefix and a stored name.
TypeScript✓ Tested
Compare a value with a limit
JavaScript: Turn a comparison into a readable yes or no result.
JavaScript✓ Tested
Compare a value with a limit
TypeScript: Turn a comparison into a readable yes or no result.
TypeScript✓ Tested
Compare bounded floating-point results with a tolerance
JavaScript: Use an absolute error threshold for values known to be near one.
JavaScript✓ Tested
Compare bounded floating-point results with a tolerance
TypeScript: Use an absolute error threshold for values known to be near one.
TypeScript✓ Tested
Compare canonically equivalent Unicode text
JavaScript: Normalize to NFC before comparing equivalent composed and decomposed text.
JavaScript✓ Tested