Results for “cr”
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 until a condition becomes true
Bash Scripts: An until loop continues while its test returns a nonzero status.
Bash Scripts✓ 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 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
Replace text with parameter expansion
Bash Scripts: Replace text with parameter expansion with a small standalone Bash program.
Bash Scripts✓ 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