# Learn Functional Programming by Building a Spreadsheet - Step 85

**URL:** <https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [March 29, 2024, 1:03am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718 "2024-03-29T01:03:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahdaouiilyas](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mahdaouiilyas/32/319931_2.png) [@mahdaouiilyas](https://forum.freecodecamp.org/u/mahdaouiilyas)\
**Post date:** [March 29, 2024, 1:03am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/1 "2024-03-29T01:03:16Z")

</div>

### Tell us what’s happening:

i don’t know how to solve this challenge  
Your apply function should call the spreadsheetFunctions[fn.toLowerCase()] function.

### Your code so far

// User Editable Region

```auto
const applyFunction = str => {
  const noHigh = highPrecedence(str);
  const infix = /([\d.]+)([+-])([\d.]+)/;
  const str2 = infixEval(noHigh, infix);
  const functionCall = /([a-z0-9]*)\(([0-9.,]*)\)(?!.*\()/i;
  const toNumberList = args => args.split(",").map(parseFloat);
  const apply = (fn, args) => spreadsheetFunctions[fn.toLowerCase()].toNumberList(args);
}

```

// 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/123.0.0.0 Safari/537.36`

### Challenge Information:

Learn Functional Programming by Building a Spreadsheet - Step 85

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-functional-programming-by-building-a-spreadsheet/step-85)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![bbsmooth](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bbsmooth/32/203556_2.png) [@bbsmooth](https://forum.freecodecamp.org/u/bbsmooth)\
**Post date:** [March 29, 2024, 1:48am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/2 "2024-03-29T01:48:16Z")

</div>

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

---

<div class="post-metadata">

**Author:** ![bbsmooth](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bbsmooth/32/203556_2.png) [@bbsmooth](https://forum.freecodecamp.org/u/bbsmooth)\
**Post date:** [March 29, 2024, 2:30am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/3 "2024-03-29T02:30:58Z")

</div>

A question for you. Do you understand what the value of `spreadsheetFunctions[fn.toLowerCase()]` is?

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [March 30, 2024, 12:00am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/4 "2024-03-30T00:00:34Z")

</div>

Hi @mahdaouiilyas

> Pass in the result of calling `toNumberList` with `args` as an argument.

You code has it as a method rather than a call.

> [@mahdaouiilyas](#):
>
> `const apply = (fn, args) => spreadsheetFunctions[fn.toLowerCase()].toNumberList(args);`

Happy coding

---

<div class="post-metadata">

**Author:** ![mahdaouiilyas](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mahdaouiilyas/32/319931_2.png) [@mahdaouiilyas](https://forum.freecodecamp.org/u/mahdaouiilyas)\
**Post date:** [March 30, 2024, 12:17am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/5 "2024-03-30T00:17:15Z")

</div>

fn represent the key inside spreadsheetFunctions object, and it will access a function based on the fn value . right!!!

---

<div class="post-metadata">

**Author:** ![bbsmooth](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bbsmooth/32/203556_2.png) [@bbsmooth](https://forum.freecodecamp.org/u/bbsmooth)\
**Post date:** [March 30, 2024, 1:41am UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/6 "2024-03-30T01:41:42Z")

</div>

> [@mahdaouiilyas](#):
>
> `spreadsheetFunctions[fn.toLowerCase()]`

If you are saying that `spreadsheetFunctions[fn.toLowerCase()]` resolves to the name of a function then you are correct. And then of course you call a function using parentheses, passing in any arguments to the function inside of the parentheses.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 28, 2024, 1:42pm UTC](https://forum.freecodecamp.org/t/learn-functional-programming-by-building-a-spreadsheet-step-85/682718/7 "2024-09-28T13:42:17Z")

</div>

Closed on September 28, 2024, 1:42pm UTC

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