The question is ofwhether the operation would be meaningful for an empty array.
Take the function count()
which returns the number of elements. That is meaningful for an empty array - the count of items would then be 0. So no need to special case the empty array. But take max()
which returns the largeslargest value in an array. That is not really meaningful for an empty array. So you will have to check for that.