Learn Functional Programming by Building a Spreadsheet - Step 103

Tell us what’s happening:

I could use some idea to point me into the right direction on this one. What can I do next to solve it? and explain what this is doing.

Your code so far

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

/* 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 => range(nums[0], nums[nums.length - 1])
  
}

// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15

Challenge Information:

Learn Functional Programming by Building a Spreadsheet - Step 103

Have a look at the second parameter in your range function. It has asked the range to end at the second number of nums. What number did you end it at?

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.