Results for “Functions & parameter validation”
Small, practical examples. Search by task or narrow things down below.
Return the first item with a generic function
Preserve the element type while allowing empty arrays.
generics✓ Tested
Select the top row in each group with a tie-breaker
SQL: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.
SQL✓ Tested
Select the top row in each group with a tie-breaker
SQL Server: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.
SQL Server✓ Tested
Select the top row in each group with a tie-breaker
Postgres: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.
Postgres✓ Tested
Select the top row in each group with a tie-breaker
SQLite: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.
SQLite✓ Tested
Substitute values into a multiline template
Bash Scripts: An unquoted heredoc delimiter enables parameter expansion in the template.
Bash Scripts✓ Tested
Transform each item in a collection
Build a result array with a foreach expression.
foreach✓ Tested
Validate a field when focus leaves it
jQuery: focusout bubbles and can support delegated form validation.
jQuery✓ Tested
Validate an email input
Use browser constraint validation for a required HTML email field.
HTML✓ Tested
Write a literal multiline block
Bash Scripts: Quoting the heredoc delimiter disables parameter and command expansion inside it.
Bash Scripts✓ Tested