_.each([1, 2, 3], function(num) { console.log(num); }); // Output: 1,2,3
var squares = _.map([1, 2, 3], function(num) { return num * num; }); // Output: [1,4,9]This example demonstrates the use of _.map to create a new array containing the squares of each number in the original array. These examples use the popular JavaScript utility library Underscore.