1.7 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.7 KiB
		
	
	
	
	
	
	
	
id, title, challengeType, forumTopicId
| id | title | challengeType | forumTopicId | 
|---|---|---|---|
| 587d7b84367417b2b2512b36 | Catch Unclosed Parentheses, Brackets, Braces and Quotes | 1 | 301190 | 
Description
Instructions
Tests
tests:
  - text: Your code should fix the missing piece of the array.
    testString: assert(code.match(/myArray\s*?=\s*?\[\s*?1\s*?,\s*?2\s*?,\s*?3\s*?\];/g));
  - text: 'Your code should fix the missing piece of the <code>.reduce()</code> method. The console output should show that "Sum of array values is: 6".'
    testString: 'assert(arraySum === 6);'
Challenge Seed
let myArray = [1, 2, 3;
let arraySum = myArray.reduce((previous, current =>  previous + current);
console.log(`Sum of array values is: ${arraySum}`);
Solution
let myArray = [1, 2, 3];
let arraySum = myArray.reduce((previous, current) =>  previous + current);
console.log(`Sum of array values is: ${arraySum}`);