Here we have written a Template to find the total of the elements in an array. We can't use this to find the total of strings because the + operator is not defined for strings.