From 2903ece39bbe619e347a2d26ab3d54827bc4dcea Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 14 Dec 2017 10:06:13 +0200 Subject: [PATCH] Update compact.md Updated description a little. --- snippets/compact.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/compact.md b/snippets/compact.md index 92dd9b767..607634b4a 100644 --- a/snippets/compact.md +++ b/snippets/compact.md @@ -1,8 +1,8 @@ ### Compact -Use `.filter()` to filter falsey values. For example false, null, 0, "", undefined, and NaN are falsey. +Use `Array.filter()` to filter out falsey values (`false`, `null`, `0`, `""`, `undefined`, and `NaN`). ```js const compact = (arr) => arr.filter(v => v); // compact([0, 1, false, 2, '', 3, 'a', 'e'*23, NaN, 's', 34]) -> [ 1, 2, 3, 'a', 's', 34 ] -``` \ No newline at end of file +```