Code doesn't work

JavaScript Algorithms and Data Structures (Beta) - Learn Functional Programming by Building a Spreadsheet

Step 20

Most spreadsheet programs include built-in functions for calculation.
Declare a sum function that takes a nums parameter, which will be an array of numbers. It should return the result of calling reduce on the array to sum all of the numbers.

My code: “const sum = nums => nums.reduce((acc, el) => acc + el, 0);
};”

or

“const sum = nums => nums.reduce((acc, el) => acc + el, 0);
};”

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

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.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

It worked…thank you very much.