1.8 KiB
1.8 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7b84367417b2b2512b36 | Catch Unclosed Parentheses, Brackets, Braces and Quotes | 1 | 抓住未封闭的圆括号,括号,括号和引号 |
Description
Instructions
Tests
tests:
- text: 您的代码应该修复数组中缺少的部分。
testString: 'assert(code.match(/myArray\s*?=\s*?\[\s*?1\s*?,\s*?2\s*?,\s*?3\s*?\];/g), "Your code should fix the missing piece of the array.");'
- text: 您的代码应该修复<code>.reduce()</code>方法的缺失部分。控制台输出应显示“数组值的总和为:6”。
testString: 'assert(arraySum === 6, "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".");'
Challenge Seed
let myArray = [1, 2, 3;
let arraySum = myArray.reduce((previous, current => previous + current);
console.log(`Sum of array values is: ${arraySum}`);
Solution
// solution required