Shorten arrayLength calculation by using ternary operator.