63 lines
1.1 KiB
Markdown
63 lines
1.1 KiB
Markdown
|
---
|
||
|
id: a3566b1109230028080c9345
|
||
|
title: Sum All Numbers in a Range
|
||
|
isRequired: true
|
||
|
challengeType: 5
|
||
|
videoUrl: ''
|
||
|
localeTitle: ''
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
undefined
|
||
|
|
||
|
## Instructions
|
||
|
undefined
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: ''
|
||
|
testString: 'assert(typeof sumAll([1, 4]) === "number", "<code>sumAll([1, 4])</code> should return a number.");'
|
||
|
- text: ''
|
||
|
testString: 'assert.deepEqual(sumAll([1, 4]), 10, "<code>sumAll([1, 4])</code> should return 10.");'
|
||
|
- text: ''
|
||
|
testString: 'assert.deepEqual(sumAll([4, 1]), 10, "<code>sumAll([4, 1])</code> should return 10.");'
|
||
|
- text: ''
|
||
|
testString: 'assert.deepEqual(sumAll([5, 10]), 45, "<code>sumAll([5, 10])</code> should return 45.");'
|
||
|
- text: ''
|
||
|
testString: 'assert.deepEqual(sumAll([10, 5]), 45, "<code>sumAll([10, 5])</code> should return 45.");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
function sumAll(arr) {
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
sumAll([1, 4]);
|
||
|
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|