Code Challenges
Code challenges for JavaScript. Each challenge links to its lesson page where you can solve it with live code execution.
3 challenges · 2 lessons03JavaScript Functions
2 challenges# Sum of Array
Given `const nums = [1, 2, 3, 4, 5]`, print the sum of all numbers using `.reduce()`.
## Expected Output
```
15
```medium# Filter Evens
Given `const nums = [1, 2, 3, 4, 5, 6, 7, 8]`, use `.filter()` to print only the even numbers as an array.
## Expected Output
```
[2,4,6,8]
```medium