Do you need this check to consider more than just the first element in the array? If so you'll need to use maxDimensions().