Check if a flat array has duplicate values

JavaScript version
const hasDuplicateValues = (arr) => new Set(arr).size !== arr.length;
TypeScript version
const hasDuplicateValues = <T,_>(arr: T[]): boolean => new Set(arr).size !== arr.length;
Examples
hasDuplicateValues(['h', 'e', 'l', 'l', 'o']); // true
hasDuplicateValues(['w', 'o', 'r', 'd']); // false