why should we use filter function in js code example Example: javascript array filter var newArray = array.filter(function(item) { return condition; });