sum of array element

by Pritesh Patel

JavaScript

function sum(arr){
	var total =0;
 arr.forEach(function(element){
 	total+=element;
 });
   return console.log(total);

}
sum([1,2,3]);