The array can be any, for example, such [1,1,1,1,2,1,3,1,1,0,1,1,0] . Those. the result should be (2,3) . Who will have any ideas? Help, plyiz)
And then my version pulls up and repeating numbers.
function unique(arr) { return arr.filter(function (item, index) { return arr.indexOf(item) === index }) } console.log(unique(array)) // [1, 2, 3, 0] And if there is an opportunity to explain to the beginner in detail, then there will generally be a fire! Thank you all in advance.