Check Input Field Value Javascript Array Sort Objects Equally Into 2