Results for “has”
Small, practical examples. Search by task or narrow things down below.
Read JSON into a hashtable
PowerShell: AsHashtable produces dictionary-style results for keys that are data rather than fixed property names.
PowerShell✓ Tested
Read stash labels without commit hashes
Git: A custom format provides predictable stash subjects.
Git✓ Tested
Remove an optional hashtable entry
PowerShell: Remove changes the map in place without changing unrelated entries.
PowerShell✓ Tested
Serialize a hashtable as JSON
Produce compact JSON for a small data object.
JSON✓ Tested
Use a fallback for a missing hashtable entry
PowerShell: Test the key explicitly so legitimate false or zero values are preserved.
PowerShell✓ Tested
Use a hash map for direct key lookup
C++: unordered_map provides key lookup without promising iteration order.
C++✓ Tested
Add a calculated property during selection
PowerShell: A calculated property can derive a value while retaining selected original properties.
PowerShell✓ Tested
Calculate a file’s SHA-256 digest
PowerShell: Get-FileHash hashes bytes without requiring the caller to load the whole file.
PowerShell✓ Tested
Construct a record with named properties
PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.
PowerShell✓ Tested
Distinguish an own property from an inherited one
JavaScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
JavaScript✓ Tested
Distinguish an own property from an inherited one
TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
TypeScript✓ Tested
Filter parents containing a matching descendant
jQuery: has retains parents with a matching descendant.
jQuery✓ Tested