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