Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sumOddNumbers(count) {
- let sum = 0;
- let oddNums = 1;
- for (let i = 0; i < count; i++) {
- console.log(oddNums);
- sum += oddNums;
- oddNums += 2;
- }
- console.log(`Sum: ${sum}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment