Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let numbers = [1, 2 -4, 3, 7, 3];
- let sum = 0;
- let product = 1;
- for (let i = 0; i < numbers.length; i++) {
- sum = sum + numbers[i];
- product = product * numbers[i];
- }
- console.log(`Sum = ${sum}`);
- console.log(`Product = ${product}`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement