Skip to content

Commit

Permalink
Merge pull request freeCodeCamp#13554 from gogolab/fix/issue13466
Browse files Browse the repository at this point in the history
Update description of beta challenge
  • Loading branch information
Greenheart authored Feb 24, 2017
2 parents b257afe + f1d555f commit 1babb06
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,17 +379,17 @@
"We earlier saw how spread operator can effectively spread, or unpack, the contents of the array.",
"We can do something similar with objects as well. <dfn>Destructuring assignment</dfn> is special syntax for neatly assigning values taken directly from an object to variables.",
"Consider the following ES5 code:",
"<blockquote>const voxel = {x: 3.6, y: 7.4, z: 6.54 };<br>const x = voxel.x; // x = 3.6<br>const y = voxel.y; // y = 7.4<br>const z = voxel.z; // z = 6.54</blockquote>",
"<blockquote>var voxel = {x: 3.6, y: 7.4, z: 6.54 };<br>var x = voxel.x; // x = 3.6<br>var y = voxel.y; // y = 7.4<br>var z = voxel.z; // z = 6.54</blockquote>",
"Here's the same assignment statement with ES6 destructuring syntax:",
"<blockquote>const { x, y, z } = voxel; // x = 3.6, y = 7.4, z = 6.54</blockquote>",
"If instead you want to store the values of <code>voxel.x</code> into <code>a</code>, <code>voxel.y</code> into <code>b</code>, and <code>voxel.z</code> into <code>c</code>, you have that freedom as well.",
"<blockquote>const { x : a, y : b, z : c } = voxel // a = 3.6, y = 7.4, z = 6.54</blockquote>",
"<blockquote>const { x : a, y : b, z : c } = voxel // a = 3.6, b = 7.4, c = 6.54</blockquote>",
"You may read it as \"get the field <code>x</code> and copy the value into <code>a</code>,\" and so on.",
"<hr>",
"Use destructuring to obtain the length of the string <code>greeting</code>"
],
"challengeSeed": [
"const greeting = 'itadakimasu'",
"const greeting = 'itadakimasu';",
"// change code below this line",
"const length = 0; // change this",
"// change code above this line",
Expand Down

0 comments on commit 1babb06

Please sign in to comment.