Learn Functional Programming by Building a Spreadsheet - Step 103

Tell us what’s happening:

I just don’t know where to start with this one. Tbh the whole exercise has been a bit of a challenge but have battled my way through it but on this don’t really know where to go. I know I need to pass two numbers through to the range function, but can’t seem to be able to find the solution after trying a tonne of stuff. Can anyone point me in the right direction?

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),
  someeven: nums => nums.some(isEven),
  everyeven: nums => nums.every(isEven),
  firsttwo: nums => nums.slice(0, 2),
  lasttwo: nums => nums.slice(-2),
  has2: nums => nums.includes(2),
  increment: nums => nums.map(num => num + 1),
  random: ([x, y]) => Math.floor(Math.random() * y + x),
  range: nums => nums.forEach(range)
}

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

Challenge Information:

Learn Functional Programming by Building a Spreadsheet - Step 103

you don’t need to iterate through nums array.

you should use your range function instead.

Try using it instead of nums.forEach, and you will get this hint:

Your range function should return an array of consecutive numbers from the first number in the argument to the second number in the argument.

from the first number in the argument to the second number in the argument ?
the argument is an array… does it mean to use the first and the second numbers in that array ?