neater way to check for the isArray method