@@ -232,7 +232,7 @@ var text = [
232
232
** Template Literals** will preserve new lines for us without having to explicitly place them in:
233
233
234
234
``` javascript
235
- var text = (
235
+ let text = (
236
236
` cat
237
237
dog
238
238
nickelodeon`
@@ -263,7 +263,7 @@ var d = arr[3];
263
263
```
264
264
265
265
``` javascript
266
- var [a, b, c, d] = [1 , 2 , 3 , 4 ];
266
+ let [a, b, c, d] = [1 , 2 , 3 , 4 ];
267
267
console .log (a); // 1
268
268
console .log (b); // 2
269
269
```
@@ -277,8 +277,8 @@ var father = luke.father; // 'anakin'
277
277
```
278
278
279
279
``` javascript
280
- var luke = { occupation: ' jedi' , father: ' anakin' }
281
- var {occupation, father} = luke;
280
+ let luke = { occupation: ' jedi' , father: ' anakin' }
281
+ let {occupation, father} = luke;
282
282
console .log (occupation); // 'jedi'
283
283
console .log (father); // 'anakin'
284
284
```
@@ -303,8 +303,8 @@ module.exports = function bar () {}
303
303
With ES6, we have various flavors of exporting. We can perform ** Named Exports** :
304
304
305
305
``` javascript
306
- export var name = ' David' ;
307
- export var age = 25 ;
306
+ export let name = ' David' ;
307
+ export let age = 25 ;
308
308
```
309
309
310
310
As well as ** exporting a list** of objects:
@@ -344,7 +344,7 @@ function sumThree(a, b) {
344
344
return a + b + c;
345
345
}
346
346
347
- var api = {
347
+ let api = {
348
348
sumTwo : sumTwo,
349
349
sumThree: sumThree
350
350
}
@@ -738,4 +738,4 @@ Promise.all(urlPromises)
738
738
.catch (function (err ) {
739
739
console .log (" Failed: " , err);
740
740
});
741
- ```
741
+ ```
0 commit comments