com.meta.xr.sdk.utilities 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +18 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
let uniqueArr = [];
|
2
|
+
|
3
|
+
function removeArrayDuplicates(arr) {
|
4
|
+
// Accepts an array from which the duplicates
|
5
|
+
// will be removed
|
6
|
+
|
7
|
+
if (!Array.isArray(arr)) {
|
8
|
+
arr = [];
|
9
|
+
}
|
10
|
+
|
11
|
+
let theSet = new Set(arr);
|
12
|
+
|
13
|
+
let uniqueArr = [...theSet];
|
14
|
+
|
15
|
+
return uniqueArr;
|
16
|
+
}
|
17
|
+
|
18
|
+
module.exports = removeArrayDuplicates;
|
package/package.json
ADDED