Sort An Array Based On Another Array Javascript Function How To Use