diff --git a/_posts/en/javascript/2017-03-12-3-array-hacks.md b/_posts/en/javascript/2017-03-12-3-array-hacks.md index 29279b40..bd946777 100644 --- a/_posts/en/javascript/2017-03-12-3-array-hacks.md +++ b/_posts/en/javascript/2017-03-12-3-array-hacks.md @@ -62,11 +62,11 @@ I personally don’t like using `null` since JavaScript treats it as an object a > method(...['parameter1', , 'parameter3']); // works! ``` -### Unique array values +### 3. Unique array values I always wonder why the Array constructor does not have a designated method to facilitate the use of unique array values. Spread operators are here for the rescue. Use spread operators with the `Set` constructor to generate unique array values. ```javascript > const arr = [...new Set([1, 2, 3, 3])]; [1, 2, 3] -``` \ No newline at end of file +```