Results for “if”
Small, practical examples. Search by task or narrow things down below.
Create a directory if needed
Ensure a directory exists before writing output.
New-Item✓ Tested
Create a modified copy of an immutable record
C#: A with expression creates a shallow copy with selected changed properties.
C#✓ Tested
Delete a known temporary file if present
Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.
Java✓ Tested
Display a specific reactive validation error
Display a specific reactive validation error with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Find differences between two collections
PowerShell: Compare-Object marks reference-only values with a left arrow and difference-only values with a right arrow.
PowerShell✓ Tested
Fit an entire image inside a differently shaped box
CSS: Contain preserves the image aspect ratio while keeping all of it visible inside the specified content box.
CSS✓ Tested
Handle the Enter key specifically
Handle the Enter key specifically with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Identify a commit exactly at a release tag
Git: Describe with exact-match refuses to invent a label for a later commit.
Git✓ Tested
Identify a search region with the search element
HTML: The native search element exposes a search landmark in supporting browsers.
HTML✓ Tested
Identify headers for individual table rows
HTML: Scope row associates the first header cell with the data cells in that row.
HTML✓ Tested
Identify the current page in a breadcrumb
HTML: An ordered breadcrumb list sits inside a named navigation region, with aria-current on the current location.
HTML✓ Tested
Identify the current practice branch
Git: Identify the current practice branch inside the disposable repository created by the input setup.
Git✓ Tested