Results for “no”
Small, practical examples. Search by task or narrow things down below.
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Count lines in a file
Count newline characters in a text file, printing only the count without the filename.
lines✓ Tested
Count occurrences in a list
Count how often each value appears using Counter from the standard library.
count✓ Tested
Count repeated lines after sorting
Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.
Linux Commands✓ Tested
Count the elements in an array
Bash Scripts: The array length form counts assigned elements, not characters in the first value.
Bash Scripts✓ Tested
Count the items in a collection
JavaScript: Read the collection’s length instead of hard-coding the loop limit.
JavaScript✓ Tested
Count the items in a collection
TypeScript: Read the collection’s length instead of hard-coding the loop limit.
TypeScript✓ Tested
Count Unicode code points in a string
JavaScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
JavaScript✓ Tested
Count Unicode code points in a string
TypeScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
TypeScript✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
Create a compressed tar archive
Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.
tar✓ Tested
Create a directory if needed
Ensure a directory exists before writing output.
New-Item✓ Tested