I am just reviewing some simple interview questions and I learned how to create a function to know when we get a duplicated value inside an array. It is suppose to return true if the value is a repeated one or false if it is not. Why am I getting all false on my outputs?
const a = [2, 3, 3, 4, 5, 2]
const b = ['ho', 'la', 'je', 'tu']
const c = [6, 7, 8, 9, 1]
const hasDuplicates = (array) =>
new Set(array).size < array.lenght
console.log(hasDuplicates(a))
console.log(hasDuplicates(b))
console.log(hasDuplicates(c))