Java Array Within Array Javascript Length Validation Vs Invalidation