Answers for "determine if array has duplicates lodash"

0

determine if array has duplicates lodash

function hasDuplicates(a) {
  return _.uniq(a).length !== a.length; 
}

var a = [1,2,1,3,4,5];
var b = [1,2,3,4,5,6];

document.write(hasDuplicates(a), ',',hasDuplicates(b));
Posted by: Guest on August-31-2021

Code answers related to "determine if array has duplicates lodash"

Code answers related to "Javascript"

Browse Popular Code Answers by Language