UNPKG
npm-helloworld-first1-package
Version:
latest (1.0.0)
1.0.0
this first NPM
npm-helloworld-first1-package
/
index.js
12 lines
(10 loc)
•
239 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
let
uniqueArr = [];
function
removeArrayDuplicates
(
arr
) {
if
(!
Array
.
isArray
(arr)) { arr = []; }
let
theSet =
new
Set
(arr);
let
uniqueArr = [...theSet];
return
uniqueArr; }
module
.
exports
= removeArrayDuplicates;