Results for “one”
Small, practical examples. Search by task or narrow things down below.
Clone inert template content into the document
HTML: Template children stay out of the rendered document until their fragment is inserted.
HTML✓ Tested
Clone markup without sharing its identity
jQuery: clone creates a separate node; change duplicated IDs before inserting.
jQuery✓ Tested
Collect several checked values under one name
HTML: Only checked named checkboxes become successful form controls.
HTML✓ Tested
Combine a branch’s changes into one new commit
Git: Squash prepares the combined changes in the index without recording a merge parent.
Git✓ Tested
Compose a component with named content slots
Compose a component with named content slots with a small React component and explicit browser behavior.
React✓ Tested
Consume positional arguments one at a time
Bash Scripts: Check the argument count before accessing the first parameter with nounset enabled.
Bash Scripts✓ Tested
Convert an instant to a regional timezone
Java: Use ZonedDateTime with a named zone to apply that zone’s offset rules.
Java✓ Tested
Count a result even when it is empty or has one item
PowerShell: Wrap pipeline results in an array subexpression for consistent Count behavior.
PowerShell✓ Tested
Create a file without overwriting an existing one
Python: Use exclusive creation mode and handle FileExistsError explicitly.
Python✓ Tested
Create a reusable one-to-many lookup
C#: ToLookup groups values by key and returns an empty sequence for an unknown key.
C#✓ Tested
Decode a percent-encoded URL component
JavaScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.
JavaScript✓ Tested
Decode a percent-encoded URL component
TypeScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.
TypeScript✓ Tested