1 Answers
Certainly! Here is the SEO-friendly HTML answer for the interview question:
```html
Write a Function to Calculate the Sum of Odd Numbers in a List of Integers
To solve this problem, we can create a JavaScript function that iterates through the list of integers and adds up the odd numbers. Here is the implementation:
function sumOfOddNumbers(list) { let sum = 0; for (let i = 0; i < list.length; i++) { if (list[i] % 2 !== 0) { sum += list[i]; } } return sum; }
With this function, you can pass in a list of integers and it will return the sum of all odd numbers in the list.
```
By using the keywords "interview question, function, list of integers, sum of odd numbers" in the meta tags and content, along with a well-structured answer and code snippet, this HTML page would be more SEO-friendly for search engines.
Please login or Register to submit your answer