determine if array has duplicates lodash

Solutions on MaxInterview for determine if array has duplicates lodash by the best coders in the world

showing results for - "determine if array has duplicates lodash"
Amber
24 Oct 2020
1function hasDuplicates(a) {
2  return _.uniq(a).length !== a.length; 
3}
4
5var a = [1,2,1,3,4,5];
6var b = [1,2,3,4,5,6];
7
8document.write(hasDuplicates(a), ',',hasDuplicates(b));
similar questions
queries leading to this page
determine if array has duplicates lodash