Javascript Functions and Arrays
Javascript Functions and Arrays
```javascript
function sumArray(arr) {
let sum = 0;
for (let i = 0; i < arr.length; i++) {
sum += arr[i];
}
return sum;
}
```
```javascript
```
Practice Questions
1. Write a function that takes an array of numbers as an argument and returns the sum of all
elements.
3. Write a function that counts the number of vowels in a string passed as an array of
characters.
4. Create a function that filters and returns only the even numbers from an array.