Remove First Element From Javascript Array Sort Function Java