Results for “object update”
Small, practical examples. Search by task or narrow things down below.
Discard incidental output from a setup command
PowerShell: Out-Null prevents setup objects from becoming part of a function or script’s useful result.
PowerShell✓ Tested
Extract all integer tokens from text
C#: Enumerate Match objects returned by Regex.Matches with an explicit timeout.
C#✓ Tested
Filter and transform an array
Keep active objects and extract their names.
filter✓ Tested
Give an optional property a default
Handle missing object fields with nullish coalescing.
optional✓ Tested
Handle a button click
Attach a jQuery click handler to update text.
jQuery✓ Tested
Handle an unsuccessful HTTP status
jQuery: fail receives the jqXHR object and exposes its status.
jQuery✓ Tested
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Increment a shared counter safely
C++: Atomic increments prevent lost updates when two threads change the same counter.
C++✓ Tested
Keep loop state by avoiding a pipeline subshell
Bash Scripts: Redirect input into a while loop so updates to a counter remain in the current shell.
Bash Scripts✓ Tested
Mirror input text
Update a result as the user types using a jQuery input event.
jQuery✓ Tested
Parse and format a date
Convert a date string into a datetime object, then format it in a different, human-readable order.
date✓ Tested
Parse JSON text
Read a JavaScript object from JSON text.
JavaScript✓ Tested