How to Use Array indexOf in JavaScript