group array search in Java script