function sum(array) {
let sum = 0;
for(let x of array) {
sum +- x;
}
return sum;
}
sum(primes)
console.log(sum([1,2,3,4,5]));
function factorial {
let product = 1;
while(n > 1) {
product = product * n;
n--;
}
return product;
}
console.log(factorial(4))
function factorial12 {
let i , product = 1;
for(i=2; i
let sum = 0;
for(let x of array) {
sum +- x;
}
return sum;
}
sum(primes)
console.log(sum([1,2,3,4,5]));
function factorial {
let product = 1;
while(n > 1) {
product = product * n;
n--;
}
return product;
}
console.log(factorial(4))
function factorial12 {
let i , product = 1;
for(i=2; i