fix(curriculum): Consolidated comments for JavaScript Algorithms and Data Structures challenges - part 3 of 4 (#38264)

* fix: remove example code from challenge seed

* fix: remove declaration from solution

* fix: added sum variable back in

* fix: reverted description back to original version

* fix: added examples to description section

* fix: added complete sentence

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: corrected typo

Co-Authored-By: Manish Giri <manish.giri.me@gmail.com>

* fix: reverted to original desc with formatted code

* fix: removed unnecessary code example from description section

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: failiing test on iterate through array with for loop

* fix: changed to Only change this line

Co-Authored-By: Manish Giri <manish.giri.me@gmail.com>

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Manish Giri <manish.giri.me@gmail.com>
Co-authored-by: moT01 <tmondloch01@gmail.com>
This commit is contained in:
Randell Dawson
2020-03-25 08:07:13 -07:00
committed by GitHub
parent 50f15886b8
commit e0e6334628
42 changed files with 176 additions and 263 deletions

View File

@ -58,8 +58,6 @@ function urlSlug(title) {
}
// Only change code above this line
var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming"
```
</div>

View File

@ -25,10 +25,10 @@ Fill in the code for the function <code>incrementer</code> so it returns the val
```yml
tests:
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code> (which is <code>4</code>).
testString: assert(fixedValue === 4);
- text: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.
testString: assert(newValue === 5);
testString: const newValue = incrementer(); assert(newValue === 5);
```
@ -49,9 +49,6 @@ function incrementer () {
// Only change code above this line
}
var newValue = incrementer(); // Should equal 5
console.log(fixedValue); // Should print 4
```
</div>
@ -69,8 +66,6 @@ var fixedValue = 4
function incrementer() {
return fixedValue + 1
}
var newValue = incrementer(); // Should equal 5
```
</section>

View File

@ -26,12 +26,12 @@ Write the <code>incrementer</code> function so it takes an argument, and then in
```yml
tests:
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code> (which is <code>4</code>).
testString: assert(fixedValue === 4);
- text: Your <code>incrementer</code> function should take a parameter.
- text: Your <code>incrementer</code> function should take an argument.
testString: assert(incrementer.length === 1);
- text: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.
testString: assert(newValue === 5);
testString: const newValue = incrementer(fixedValue); assert(newValue === 5);
```
@ -52,9 +52,6 @@ function incrementer () {
// Only change code above this line
}
var newValue = incrementer(fixedValue); // Should equal 5
console.log(fixedValue); // Should print 4
```
</div>
@ -67,13 +64,9 @@ console.log(fixedValue); // Should print 4
<section id='solution'>
```js
// The global variable
var fixedValue = 4;
const incrementer = val => val + 1;
var newValue = incrementer(fixedValue); // Should equal 5
console.log(fixedValue); // Should print 4
```
</section>