You can use Boolean :
var myFilterArray = myArray.filter(Boolean);
More Related Contents:
- Filter JSON by key value with JavaScript
- fetch first element of every string in array using javascript [closed]
- Accesing 2d arrays from Javascript [closed]
- How to remove all duplicates from an array of objects?
- Determine whether an array contains a value [duplicate]
- Javascript call() & apply() vs bind()?
- Best way to find if an item is in a JavaScript array? [duplicate]
- Most efficient way to create a zero filled JavaScript array?
- How to convert an Object {} to an Array [] of key-value pairs in JavaScript
- Sort array of objects by single key with date value
- What is “undefined x 1” in JavaScript?
- Why Array.indexOf doesn’t find identical looking objects
- How to count the number of occurrences of each item in an array? [duplicate]
- JavaScript – why Array.prototype.fill actually fills a “pointer” of object when filling anything like ‘new Object()’
- Convert object array to hash map, indexed by an attribute value of the Object
- Check if array contains all elements of another array
- How much faster are arrays than accessing Google Sheets cells within Google Scripts?
- Getting index of an array’s element based on its properties
- Javascript remove all occurrence of duplicate element, leaving the only one that is unique
- JavaScript: Remove duplicates of objects sharing same property value
- Sieve of Eratosthenes algorithm in JavaScript running endless for large number
- What is the difference between a shallow copy and a deep copy with JavaScript arrays? [duplicate]
- JavaScript filter array by data from another
- How do I unset an element in an array in javascript?
- javascript – match string against the array of regular expressions
- How to find the coordinate that is closest to the point of origin?
- How are JavaScript arrays implemented?
- Compare two Arrays with Objects and create new array with unmatched objects
- Difference between ( for… in ) and ( for… of ) statements?
- Find object having maximum value for the `id` property in an array of objects