Loop through an array

How to loop through an array in shell scripting

array=("first" "second" "third")

for item in ${array[@]}; do
  echo $item
done