Underscore.js Collections: Filter

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<a target="parent" href="http://underscorejs.org/#filter">Learn More</a>

JavaScript

var arr  = [1, 2, 3, 4, 5, 6];

var evens = _.filter(arr, function(num){ 
    
    return num % 2 == 0; 

});

console.log(evens,"are the even numbers in the array");