diff --git a/collections/array/remove-duplicate-values-in-an-array.md b/collections/array/remove-duplicate-values-in-an-array.md index d78ea3d8..27b6a97e 100644 --- a/collections/array/remove-duplicate-values-in-an-array.md +++ b/collections/array/remove-duplicate-values-in-an-array.md @@ -3,4 +3,7 @@ const removeDuplicate = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexO // Example removeDuplicate(['h', 'e', 'l', 'l', 'o', 'w', 'o', 'r', 'l', 'd']); //  ['h', 'e', 'w', 'r', 'd'] -~~~ \ No newline at end of file + +// or +const removeDuplicate = arr => Array.from(new Set(arr)); +~~~