Hi,
I altered your function so that it could take any number of elements in an array and summarizes it.
<html>
<head>
<script>
function Add(d){
var sum=0;
d.forEach(item=>{
sum+=parseInt(item);
});
return sum
}
</script>
</head>
<body bgcolor="aqua">
<script>
var num=[];
for(i=0;i<10;i++){
num.push(prompt("Enter value at "+i));
}
alert("The sum of the ten numbers is " + Add(num));
</script>
</body>
</html>