Contains Method In Javascript Array Sort Function