---
title: "Comment by Anthony Fung on \"Getting rid of falsy values from arrays: the super simple guide\" | Hashnode"
description: "Good solution! You can do the same by relying on the truthiness of a value too, e.g. myArray.filter(n =&gt; n); . Something to be careful of is that 0 is consid"
url: "https://hashnode.com/posts/getting-rid-of-falsy-values-from-arrays-the-super-simple-guide/641e19ed32ea565017652899/comment/641e234d05c482464c90a850"
---

[Discussion](https://hashnode.com/posts/getting-rid-of-falsy-values-from-arrays-the-super-simple-guide/641e19ed32ea565017652899)

Comment [Getting rid of falsy values from arrays: the super simple guide](https://hashnode.com/posts/getting-rid-of-falsy-values-from-arrays-the-super-simple-guide/641e19ed32ea565017652899)

[Anthony Fung](https://hashnode.com/@anthonyf)

[Mar 24, 2023](https://hashnode.com/posts/getting-rid-of-falsy-values-from-arrays-the-super-simple-guide/641e19ed32ea565017652899/comment/641e234d05c482464c90a850)

Good solution!

You can do the same by relying on the truthiness of a value too, e.g. `myArray.filter(n => n);`. Something to be careful of is that `0` is considered a falsy value.
