Javascript Finding Value In Array Javascript Length Validation