Exit if array is empty oneliner

(( ${#array[@]} )) || { echo "array is empty"; exit 1; }

where (( ${#array[@]} )) checks the array length.