Learn Functional Programming by Building a Spreadsheet - Step 99

Tell us what’s happening:

What is the issue with my increment property?
Here is my error msg:
Your increment function should return an array of numbers incremented by one.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const spreadsheetFunctions = {
  sum,
  average,
  median,
  even: nums => nums.filter(isEven),
  firsttwo: nums => nums.slice(0, 2),
  lasttwo: nums => nums.slice(-2),
  has2: nums => nums.includes(2),
  increment: nums => nums.every((nums) => nums+1),
  
}

// 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/128.0.0.0 Safari/537.36

Challenge Information:

Learn Functional Programming by Building a Spreadsheet - Step 99

Hi there!

You need to return an array incremented by 1.
Currently you are returning the reference of an array nums.

does this code return an array if called?

I think using ‘every’ will not return an array as requested?
(feel free to look up what every returns on this website: Array.prototype.every() - JavaScript | MDN )

increment : nums.map(num => num + 1), this should work fine right but still I am not able to pass this

Increment is supposed to be an an arrow function. So change the code to an arrow function that takes a parameter called nums.