My ‘even’ function looks correct but get:
// running tests
Your even function should take a nums parameter.
Your even function should return the result of calling the .filter() method on nums.
You should pass a reference to your isEven() function as the callback for the .filter() method.
// tests completed
const even = (nums) => nums.filter((num) => isEven(num));
### Your code so far
```html
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const isEven = num => num % 2 === 0;
const sum = nums => nums.reduce((acc, el) => acc + el, 0);
const average = nums => sum(nums) / nums.length;
const even = (nums) => nums.filter((num) => isEven(num));
const spreadsheetFunctions = {
sum,
average,
median,
even
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Challenge Information:
Learn Functional Programming by Building a Spreadsheet - Step 97
i don’t have this code in my step (as mentioned by DobarBREND you seem to have deleted some code and added code in the wrong location), so you should definitely reset and retry this step.
You only need to add one property to the object.
Then I added the even function to the spreadsheetFunctions object:
const spreadsheetFunctions = {
sum,
average,
median,
even
}
And I get:
// running tests Your
even function should take a nums parameter.
Your even function should return the result of calling the .filter() method on nums .
You should pass a reference to your isEven() function as the callback for the .filter() method.
// tests completed
This is a variable called even.
But they don’t want a variable called even.
They want you to update the object and add a property called even.
Do you remember how that’s done?