FIND YOUR NEXT FEW LINES

Results for “comparison”

Small, practical examples. Search by task or narrow things down below.

48 snippets foundClear filters
TypeScriptArray traversal & selection

Check array membership with includes

TypeScript: includes uses SameValueZero comparison, which also matches NaN.

TypeScript✓ Tested
JavaScriptText handling & Unicode

Check whether text starts with a prefix

JavaScript: Use startsWith for a literal case-sensitive prefix comparison.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Check whether text starts with a prefix

TypeScript: Use startsWith for a literal case-sensitive prefix comparison.

TypeScript✓ Tested
PowerShellFunctions & control

Choose an action with switch

Map a small command value to a result.

switch✓ Tested
Bash ScriptsText parsing & arithmetic

Clamp a numeric setting to a valid range

Bash Scripts: Use arithmetic comparisons before applying a user-supplied bounded setting.

Bash Scripts✓ Tested
CNumeric parsing & arithmetic

Clamp an integer to inclusive bounds

C: Explicit comparisons avoid relying on nonstandard min or max macros.

C✓ Tested
SQLSubqueries & ranked selection

Compare a row with its own group average

SQL: A correlated aggregate computes a different comparison value for each group.

SQL✓ Tested
SQL ServerSubqueries & ranked selection

Compare a row with its own group average

SQL Server: A correlated aggregate computes a different comparison value for each group.

SQL Server✓ Tested
PostgresSubqueries & ranked selection

Compare a row with its own group average

Postgres: A correlated aggregate computes a different comparison value for each group.

Postgres✓ Tested
SQLiteSubqueries & ranked selection

Compare a row with its own group average

SQLite: A correlated aggregate computes a different comparison value for each group.

SQLite✓ Tested
PythonText validation & encoding

Compare Unicode text without case

Python: Casefold handles more Unicode case mappings than lower for caseless comparison.

Python✓ Tested
C#Strings

Find text ignoring case

Use ordinal case-insensitive comparison for a C# substring search.

C#✓ Tested