Results for “code”
Small, practical examples. Search by task or narrow things down below.
Read the final array item with a negative index
TypeScript: at supports negative positions counted from the end.
TypeScript✓ Tested
Read the first array element
Bash Scripts: Read the first array element with a small standalone Bash program.
Bash Scripts✓ Tested
Read the first collection element
Python: Access index zero only after establishing that the collection is nonempty.
Python✓ Tested
Read the first collection element
C#: Access index zero only after establishing that the collection is nonempty.
C#✓ Tested
Read the first collection element
Java: Access index zero only after establishing that the collection is nonempty.
Java✓ Tested
Read the first collection element
JavaScript: Access index zero only after establishing that the collection is nonempty.
JavaScript✓ Tested
Read the first collection element
TypeScript: Access index zero only after establishing that the collection is nonempty.
TypeScript✓ Tested
Read the first collection element
C++: Access index zero only after establishing that the collection is nonempty.
C++✓ Tested
Read the first collection element
C: Access index zero only after establishing that the collection is nonempty.
C✓ Tested
Read the kind of command being invoked
PowerShell: CommandType distinguishes cmdlets from functions, aliases, and external applications.
PowerShell✓ Tested
Read the last array element
PowerShell: A negative array index counts backward from the end.
PowerShell✓ Tested
Read the last value of the complete partition
SQL: Specify an unbounded-following frame so LAST_VALUE does not stop at the current row.
SQL✓ Tested