I attempted to create two functions with the same name, one that required a starting point and another without one. However, I encountered an issue where the function without a start point resulted in NaN.
function sum(array,start){
return array.reduce((result, item) => result + item,start);
}
console.log(sum([1,8],8))
function sum(array){
return array.reduce((result, item) => result + item);
}
console.log(sum([1,8]))