Learn Functional Programming by Building a Spreadsheet - Step 99

Tell us what’s happening:

In the exercise below, I was instructed to add has2 property within the spreadsheetFunctions object, which should return a Boolean values; if the nums array contain 2. I got that successfully. The next task is to add increment property to the spreadsheetFunctions object and returns nums in every value incremented by one. I have incremented nums by one but I am still stuck. Can someone please help me with some clued

Your code so far

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) ? true : false,
  increment: nums => nums++ ,
}

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

Challenge Information:

Learn Functional Programming by Building a Spreadsheet - Step 99

do you still need help?

Hbar thanks for your concern. I managed to increment it using the map method.

1 Like