array-has-duplicates
Check if an Array
includes duplicated values or not
; //=> false; //=> true
Installation
npm install array-has-duplicates
API
arrayHasDuplicates(array)
array: Array<any>
Return: boolean
It returns true
if the array includes at least one pair of duplicated values, otherwise returns false
.
; //=> true; //=> false
"Duplicated" means a value is identical to with another value in the ECMAScript same-value equality level.
; //=> false
Note that it ignores all empty indexes.
;//=> false, though array[0] and array[1] are both `undefined`
License
ISC License © 2018 Shinnosuke Watanabe