Creating Random Array Javascript Length Validation