Returns the first non-null value in an expression. It is commonly used to provide safe default values without verbose null checks.
string name = input ?? "Unknown";
An inline conditional expression that replaces simple if/else statements. It improves readability when logic is short and expressive.
var role = isAdmin ? "Admin" : "User";
Splits a string into an array based on a delimiter. Useful for parsing CSV values, paths, or structured input.
var parts = csv.Split(',');
Combines collections into a single string using a delimiter. Often used to rebuild CSV strings or display lists.
var csv = string.Join(",", values);
Projects objects into a new form by selecting specific properties. This is foundational for LINQ transformations.
users.Select(u => u.Name);
Represents the current object flowing through the pipeline. It allows concise access to properties during filtering and iteration.
Get-Process | Where-Object { $_.CPU -gt 100 }
-eq performs exact comparisons while -like supports wildcard matching. Choosing correctly avoids subtle filtering bugs.
Name -eq "Bob" Name -like "Bo*"
Forces output into an array even if one item is returned. This prevents edge-case failures when iterating results.
$items = @(Get-Service)
Extracts raw property values instead of wrapped objects. Useful when passing clean data to other commands.
$obj | Select -Expand Name
Write-Output sends data to the pipeline while Write-Host only writes to the console. Understanding the difference prevents broken scripts.
Write-Output "Pipeline Safe" Write-Host "Console Only"
Converts a delimited string into rows. Often used to process CSV input passed into stored procedures.
SELECT value FROM STRING_SPLIT('a,b,c', ',');
Aggregates multiple rows into a single delimited string. Useful for reporting and compact result sets.
SELECT STRING_AGG(Name, ',') FROM Users;
Both replace NULL values, but COALESCE supports multiple arguments and is ANSI-compliant. It's generally preferred for portability.
COALESCE(col, 'N/A')
Checks for the existence of rows without returning data. It is often faster than counting rows.
WHERE EXISTS (SELECT 1 FROM Orders)
Evaluates table-valued functions per row. It enables powerful row-by-row computations.
FROM Users CROSS APPLY dbo.GetRoles(Users.Id)
Returns a fallback only when a value is null or undefined. This avoids unintended overrides from false values like 0 or empty strings.
const name = input ?? "Guest";
Safely accesses deeply nested properties. It prevents runtime errors when objects are missing.
user?.profile?.email
Transforms arrays into new arrays without mutation. It is a core functional programming pattern in JavaScript.
items.map(x => x.id)
=== enforces type-safe comparison while == allows coercion. Using strict equality avoids subtle bugs.
1 === "1" // false
Enables cleaner string interpolation and multi-line strings. It improves readability over traditional concatenation.
`Hello ${name}`