Apply new format to snippets and template
This commit is contained in:
@ -5,7 +5,7 @@ tags: array,beginner
|
||||
|
||||
Returns all unique values in an array.
|
||||
|
||||
Create a `Set` from the given array to discard duplicated values, then use the spread operator (`...`) to convert it back to an array.
|
||||
- Create a `Set` from the given array to discard duplicated values, then use the spread operator (`...`) to convert it back to an array.
|
||||
|
||||
```js
|
||||
const uniqueElements = arr => [...new Set(arr)];
|
||||
|
||||
Reference in New Issue
Block a user