Results for “array”
Small, practical examples. Search by task or narrow things down below.
Store several readings in an array
Arduino / C: Store several readings in an array on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Sum array values
Iterate over a fixed C array using a size-derived element count.
C✓ Tested
Test whether an array contains a value
PowerShell: The contains operator compares complete items rather than matching substrings.
PowerShell✓ Tested
Transform a collection into a plain array
jQuery: map followed by get returns ordinary JavaScript values.
jQuery✓ Tested
Transform array values
Use map to create a JavaScript array of squared values.
JavaScript✓ Tested
Update one array item by its identifier
Update one array item by its identifier with a small React component and explicit browser behavior.
React✓ Tested
Visit associative-array keys in a stable order
Bash Scripts: Associative arrays have no defined iteration order, so sort their keys explicitly.
Bash Scripts✓ Tested
Visit every reading in a fixed array
Arduino / C: Visit every reading in a fixed array on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Advance an index around a fixed collection
Arduino / C: Modulo wraps a bounded nonnegative index to zero.
Arduino / C✓ Tested
Append a dynamic form control
Append a dynamic form control with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested
Build a mutable generic list
PowerShell: A generic list supports repeated additions without copying an entire array each time.
PowerShell✓ Tested