Skip to content

Commit 4d19747

Browse files
Merge pull request #418 from wzhouwzhou/feature/wzhouwzhou-unique-array
Retrieve unique values from an array (JS)
2 parents 3199913 + 6bda45d commit 4d19747

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const values = [1, 2, 3, 4, 5, 1, 1, 1, 3];
2+
3+
const unique = [void(0)].map((e, i, arr) => new Set(values).forEach(v => arr.push(v)) || arr)[0].slice(1);

0 commit comments

Comments
 (0)