We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Display an element of an array
Display an element of an array
Sort by
recency
|
94 Discussions
|
Please Login in order to post a comment
To display an element of an array, you can access it using its index, with array indexing starting at 0. For example,
console.log(array[2]);
will display the third element in the array. Ensure that the index is within the bounds of the array to avoid errors. Cricbet99My solution> #!/bin/bash
array=()
while read -r entrada || [ -n "entrada") done
echo ${array[3]}