how to filter through an array in javascript code example Example: filter out arrays js let newArray = array.filter(function(item) { return condition; });