Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### compact
|
||||
---
|
||||
title: compact
|
||||
tags: array,beginner
|
||||
---
|
||||
|
||||
Removes falsy values from an array.
|
||||
|
||||
@ -10,4 +13,4 @@ const compact = arr => arr.filter(Boolean);
|
||||
|
||||
```js
|
||||
compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]); // [ 1, 2, 3, 'a', 's', 34 ]
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user