Say I have an array like this: [1, 1, 2, 2, 3]
[1, 1, 2, 2, 3]
I want to get the duplicates which are in this case: [1, 2]
[1, 2]
Does lodash support thi
Another way, but using filters and ecmaScript 2015 (ES6)
var array = [1, 1, 2, 2, 3]; _.filter(array, v => _.filter(array, v1 => v1 === v).length > 1); //→ [1, 1, 2, 2]