Results for “node”
Small, practical examples. Search by task or narrow things down below.
Repeat a string a fixed number of times
TypeScript: String.repeat requires a nonnegative finite repetition count.
TypeScript✓ Tested
Repeat while a condition holds
JavaScript: Count down while a positive number remains, updating the loop variable on each iteration.
JavaScript✓ Tested
Repeat while a condition holds
TypeScript: Count down while a positive number remains, updating the loop variable on each iteration.
TypeScript✓ Tested
Replace all literal matches
Replace repeated substrings with JavaScript replaceAll.
JavaScript✓ Tested
Replace an array segment in place
JavaScript: splice returns removed items and inserts replacements at the chosen position.
JavaScript✓ Tested
Replace an array segment in place
TypeScript: splice returns removed items and inserts replacements at the chosen position.
TypeScript✓ Tested
Replace an element while preserving its position
jQuery: replaceWith swaps an entire node.
jQuery✓ Tested
Replace one collection element
JavaScript: Update an existing element at a known valid index.
JavaScript✓ Tested
Replace one collection element
TypeScript: Update an existing element at a known valid index.
TypeScript✓ Tested
Require two conditions to be true
JavaScript: Combine a lower and an upper bound to check whether a value is in range.
JavaScript✓ Tested
Require two conditions to be true
TypeScript: Combine a lower and an upper bound to check whether a value is in range.
TypeScript✓ Tested
Resolve a relative URL against a base
JavaScript: A trailing slash makes the final base path component a directory.
JavaScript✓ Tested