Tell us what’s happening:
whats the problem?
Your code so far
let myArray = [1, 2, 3];
let arraySum = myArray.reduce(previous, current) => previous + current);
console.log(`Sum of array values is: ${arraySum}`);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
.
Challenge: Catch Unclosed Parentheses, Brackets, Braces and Quotes
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
What are you trying to do? What do the failing tests say? What else have you tried?
Take a look at https://devdocs.io/javascript/global_objects/array/reduce to get more details of how the reduce function works.
That, however, won’t fix your syntax error. Count how many (
you have on the reduce line, then count the )
on that same line. They Should be the same. Are they?