Answers for "how to check array for dublicated values js"

1

javascript create array with repeated values

Array(5).fill(2)
//=> [2, 2, 2, 2, 2]
Posted by: Guest on February-17-2021
0

javascript check for duplicates in array

function checkIfDuplicateExists(w){
    return new Set(w).size !== w.length 
}

console.log(
    checkIfDuplicateExists(["a", "b", "c", "a"])
// true
);

console.log(
    checkIfDuplicateExists(["a", "b", "c"]))
//false
Posted by: Guest on September-16-2021

Code answers related to "how to check array for dublicated values js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language