Results for “New-Item”
Small, practical examples. Search by task or narrow things down below.
Find the index of an array item
PowerShell: Array.IndexOf returns -1 when the requested item is absent.
PowerShell✓ Tested
Find the position of a matching item
JavaScript: findIndex returns -1 when the predicate matches nothing.
JavaScript✓ Tested
Find the position of a matching item
TypeScript: findIndex returns -1 when the predicate matches nothing.
TypeScript✓ Tested
Give an item the remaining horizontal space
CSS: A growing flex item absorbs free space after fixed items have been sized.
CSS✓ Tested
Insert a list item at the beginning
jQuery: Learn how to insert a list item at the beginning in a complete browser example.
jQuery✓ Tested
Insert an item at the beginning
jQuery: prepend inserts before the existing children.
jQuery✓ Tested
Join array items with a one-character separator
Bash Scripts: A local IFS controls the separator used by the quoted star expansion.
Bash Scripts✓ Tested
List newly added staged files only
Git: Filter the cached diff by added status while leaving modified files out.
Git✓ Tested
Map items to multiple output values
JavaScript: flatMap combines mapping and a one-level flattening operation.
JavaScript✓ Tested
Map items to multiple output values
TypeScript: flatMap combines mapping and a one-level flattening operation.
TypeScript✓ Tested
Move a file to a new filename
C#: File.Move changes the file path without loading its contents.
C#✓ Tested
Move a file to a new name
Java: Files.move changes the path and returns the destination Path.
Java✓ Tested