Results for “no”
Small, practical examples. Search by task or narrow things down below.
Sum numeric values
Provide an initial accumulator for JavaScript reduce, including empty arrays.
JavaScript✓ Tested
Sum typed values with reduce
Accumulate numeric array elements.
reduce✓ Tested
Sum values per category
Calculate a grouped total.
SUM✓ Tested
Take a page from a stream
Java: Use skip and limit with a known stable input order.
Java✓ Tested
Test any and all elements with predicates
C++: These algorithms stop as soon as their result is known.
C++✓ Tested
Test missing values with IS NULL
Find rows where an optional value is absent.
IS NULL✓ Tested
Test whether an array contains a value
PowerShell: The contains operator compares complete items rather than matching substrings.
PowerShell✓ Tested
Test whether an unsigned value is a power of two
C: A nonzero power of two has exactly one set bit.
C✓ Tested
Toggle a state class
Toggle a CSS class in a jQuery click handler.
jQuery✓ Tested
Transform a resolved promise result
JavaScript: A then handler returns the value passed to the next promise in the chain.
JavaScript✓ Tested
Transform a resolved promise result
TypeScript: A then handler returns the value passed to the next promise in the chain.
TypeScript✓ Tested
Transform array values
Use map to create a JavaScript array of squared values.
JavaScript✓ Tested