javascript for element of array filter code example Example: javascript array filter var newArray = array.filter(function(item) { return condition; });