@@ -83,7 +83,19 @@ for(var i=0; i<list.length; i++){
8383// 2 c
8484```
8585
86- We can do the same thing with the powerful ` forEach ` Array method:
86+ We can do the same thing with the new ES6 [ ` for...of ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of ) loop:
87+
88+ ```
89+ let list = ["a", "b", "c"];
90+ for(let item of list){
91+ console.log(item);
92+ }
93+ // a
94+ // b
95+ // c
96+ ```
97+
98+ And we can do the same thing with the powerful ` forEach ` Array method:
8799```
88100var list = ["a", "b", "c"];
89101list.forEach(function(value, i){
@@ -95,7 +107,7 @@ list.forEach(function(value, i){
95107```
96108
97109
98- ## What is Concatenation?
110+ ## What is Concatenation? (Hard!)
99111When we combine strings together, it's known as "concatenation". Here's an example:
100112
101113```
@@ -130,5 +142,21 @@ var dynamic_paragraph = (
130142dynamic_paragraph //=> "<p>words words words!</p>"
131143```
132144
145+ ## What is a Template String? (Easy!)
146+ New to ES6 are template strings. Once you get the hang of it, these are a lot easier than the string concatenation method above.
147+
148+ ```
149+ let foo = "bar";
150+ `${foo}`; //=> "bar"
151+ `${foo} ${foo}` //=> "bar bar"
152+ ```
153+
154+ ```
155+ let words = "words words words";
156+ let html_string = `<p>${words}!</p>`;
157+
158+ html_string //=> "<p>words words words!</p>"
159+ ```
160+
133161## Solution
134162Please see the ` solution ` branch!
0 commit comments