Check Input Field Value Javascript Array Methods