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