Challenge - ES6: Use Destructuring Assignment to Assign Variables from Arrays - Added solution (#26531)

* added solution for challenge

* removed function from seed and solution
This commit is contained in:
Alan Price
2019-01-24 19:24:27 +00:00
committed by Paul Gamble
parent 81cc40bfee
commit 23096f7ed6

View File

@ -42,13 +42,11 @@ tests:
<div id='js-seed'>
```js
"use strict";
let a = 8, b = 6;
(() => {
"use strict";
// change code below this line
// change code below this line
// change code above this line
})();
// change code above this line
console.log(a); // should be 6
console.log(b); // should be 8
```
@ -63,6 +61,12 @@ console.log(b); // should be 8
<section id='solution'>
```js
// solution required
"use strict";
let a = 8, b = 6;
// change code below this line
[a, b] = [b, a];
// change code above this line
console.log(a); // should be 6
console.log(b); // should be 8
```
</section>