determine if array has duplicates lodash

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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