FIND YOUR NEXT FEW LINES

Results for “while”

Small, practical examples. Search by task or narrow things down below.

162 snippets foundClear filters
jQueryInsertion & wrapping

Replace an element while preserving its position

jQuery: replaceWith swaps an entire node.

jQuery✓ Tested
jQueryGetting Started

Respond while a user types

jQuery: Learn how to respond while a user types in a complete browser example.

jQuery✓ Tested
JavaScriptArray restructuring

Reverse a copy while preserving the original

JavaScript: Copy before reverse because reverse mutates the array it receives.

JavaScript✓ Tested
TypeScriptArray restructuring

Reverse a copy while preserving the original

TypeScript: Copy before reverse because reverse mutates the array it receives.

TypeScript✓ Tested
PowerShellArray operations

Reverse a copy while preserving the source

PowerShell: Clone the array before using Array.Reverse because Reverse mutates its argument.

PowerShell✓ Tested
Linux CommandsStreams & byte tools

Save a stream while displaying it

Linux Commands: Use tee to write a copy of standard input to a file.

Linux Commands✓ Tested
jQueryTraversal & selection

Select siblings while excluding the current element

jQuery: siblings selects other children of the same parent.

jQuery✓ Tested
Bash ScriptsText parsing & arithmetic

Split a record while retaining its remainder

Bash Scripts: The final read variable receives the remainder of a delimited record.

Bash Scripts✓ Tested
HTMLNative disclosure & dialogs

Start a disclosure open while keeping it collapsible

HTML: The open attribute sets the initial details state without JavaScript.

HTML✓ Tested
GitStashing selected work

Stash unstaged work while leaving staged edits available

Git: Keep-index preserves the staged state for testing or committing while stashing the rest.

Git✓ Tested
GitRestoring & revising local work

Stop tracking a generated file while keeping it locally

Git: Removing a path from the index leaves its working copy intact when cached is specified.

Git✓ Tested
HTMLForm behavior

Submit a readonly value while preventing edits

HTML: Readonly controls remain in form data, unlike disabled controls.

HTML✓ Tested