jQuery.unique on an array of strings

后端 未结 8 583
野趣味
野趣味 2020-11-29 05:16

The description of jQuery.unique() states:

Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays

8条回答
  •  猫巷女王i
    2020-11-29 05:37

    I know unique works with DOM but this WORKS on arrays of int:

    $.unique(arr.sort());
    

提交回复
热议问题