constsumNums=(arr)=>{let sum=0;for(let t =0; t < arr.length; t++){if(typeof arr[t]=="number"){
sum = sum + arr[t];}}return sum;}//if you find this answer is useful ,//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
functionaddSum(array){// call the function with your array parameterlet solution =0for(let x =0; x < array.length;x++){// for loop
solution = solution + array[x]}return solution
}
// If you do not want to use array.reduece you can itereate through the array and then get the solution.constgetSum=(arr)=>{let sum =0;for(key of arr){
sum += key
}return sum
}
// sum of all number functionsum(){letInValue=0for(let index =0; index < arguments.length; index++){InValue+=arguments[index];}console.log(`Total sum of all number is = ${InValue}`);}sum(10,10,10);