fix(learn): improved tests for validating incrementer function (#39385)
* Update avoid-mutations-and-side-effects-using-functional-programming.english.md * Update avoid-mutations-and-side-effects-using-functional-programming.english.md * Update avoid-mutations-and-side-effects-using-functional-programming.english.md * fix typo in avoid-mutations-and-side-effects-using-functional-programming.english.mdpull/38560/head
parent
705cba67bc
commit
e7718e5c3f
|
@ -29,7 +29,15 @@ tests:
|
|||
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code> (which is <code>4</code>).
|
||||
testString: incrementer(); assert(fixedValue === 4);
|
||||
- text: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.
|
||||
testString: const newValue = incrementer(); assert(newValue === 5);
|
||||
testString: const __newValue = incrementer(); assert(__newValue === 5);
|
||||
- text: Your <code>incrementer</code> function should return a value based on the global `fixedValue` variable value.
|
||||
testString: |
|
||||
(function() {
|
||||
fixedValue = 10;
|
||||
const newValue = incrementer();
|
||||
assert(fixedValue === 10 && newValue === 11);
|
||||
fixedValue = 4;
|
||||
})();
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue