var addTwo = function(element, index, array){ //show all arguments passed return element + 2; }; console.log([2,4,6].map(addTwo)); //logs [4, 6, 8]