Solution mutate-an-array-declared-with-const.english.md (#18759)

* Update mutate-an-array-declared-with-const.english.md

* Improved JavaScript style
pull/19354/merge
Prabhat Kumar Sahu 2018-10-16 05:24:43 +05:30 committed by Todd Chaffee
parent 1e3804889e
commit b13e23037c
1 changed files with 13 additions and 2 deletions

View File

@ -44,7 +44,7 @@ tests:
```js
const s = [5, 7, 2];
function editInPlace() {
"use strict";
'use strict';
// change code below this line
// s = [2, 5, 7]; <- this is invalid
@ -64,6 +64,17 @@ editInPlace();
<section id='solution'>
```js
// solution required
const s = [5, 7, 2];
function editInPlace() {
'use strict';
// change code below this line
// s = [2, 5, 7]; <- this is invalid
s[0] = 2;
s[1] = 5;
s[2] = 7;
// change code above this line
}
editInPlace();
```
</section>