Remove Duplicate Javascript Array Sort Function In Javascript