JQuery $ .unique () problem, i.e.

var arr = new Array (); arr [0] = 'Departmental news' arr [1] = 'Departmental news' arr [2] = 'Another cat' arr [3] = 'Another cat' arr [4] = 'Departmental news'

            alert(arr)

            alert($.unique(arr))

In IE, I get duplicates. In any other browser, only unique

Any ideas?

+3
source share
2 answers

This is the intended behavior. Although it $.unique()really works for strings in most cases, this is not guaranteed, the documentation only states for DOM elements.

From the docs :

DOM . , DOM, .

, , DOM -, , /, .

+7
+3

Source: https://habr.com/ru/post/1742453/


All Articles