Skip to content

Commit f7110fd

Browse files
committed
fixed order bo examples
1 parent 7371b21 commit f7110fd

6 files changed

+45
-29
lines changed

examples/chapter01/10-ObjectOrientedJS.html examples/chapter01/09-ObjectOrientedJS.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<title></title>
66
</head>
77
<body>
8-
<script type="text/javascript" src="10-ObjectOrientedJS.js"></script>
8+
<script type="text/javascript" src="09-ObjectOrientedJS.js"></script>
99
</body>
10-
</html>
10+
</html>

examples/chapter01/11-ES2015-ES6-letconst.html examples/chapter01/10-ES2015-ES6-letconst.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title></title>
66
</head>
77
<body>
8-
<script type="text/javascript" src="11-ES2015-ES6-letconst.js"></script>
8+
<script type="text/javascript" src="10-ES2015-ES6-letconst.js"></script>
99

1010
</body>
1111
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// @ts-check
2+
/* eslint-disable */
3+
4+
//* ****** EcmaScript 2015 (ES6): let and const keywords
5+
6+
//* ****** EcmaScript 2015 (ES6): let is the new var (https://goo.gl/he0udZ)
7+
var framework = 'Angular';
8+
var framework = 'React';
9+
console.log(framework);
10+
11+
let language = 'JavaScript!'; // {1}
12+
// let language = 'Ruby!'; // {2} - throws error
13+
console.log(language);
14+
15+
16+
//* ****** EcmaScript 2015 (ES6): const (https://goo.gl/YUQj3r)
17+
const PI = 3.141593;
18+
// PI = 3.0; //throws error
19+
console.log(PI);
20+
21+
const jsFramework = {
22+
name: 'Angular'
23+
};
24+
jsFramework.name = 'React';
25+
26+
// error, cannot reassign object reference
27+
/*
28+
jsFramework = {
29+
name: 'Vue'
30+
};
31+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="11-ES2015-ES6-variableScope.html.js"></script>
9+
10+
</body>
11+
</html>

examples/chapter01/11-ES2015-ES6-letconst.js examples/chapter01/11-ES2015-ES6-variableScope.html.js

-26
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
// @ts-check
22
/* eslint-disable */
33

4-
//* ****** EcmaScript 2015 (ES6): let and const keywords
5-
6-
//* ****** EcmaScript 2015 (ES6): let is the new var (https://goo.gl/he0udZ)
7-
var framework = 'Angular';
8-
var framework = 'React';
9-
console.log(framework);
10-
11-
let language = 'JavaScript!'; // {1}
12-
// let language = 'Ruby!'; // {2} - throws error
13-
console.log(language);
14-
154
//* ****** EcmaScript 2015 (ES6): variables scope (https://goo.gl/NbsVvg)
165
let movie = 'Lord of the Rings'; // {1}
176
// var movie = 'Batman v Superman'; //throws error, variable movie already declared
@@ -54,19 +43,4 @@ blizzardFan(); // {12}
5443
// Inside if: For the Horde!
5544
// After if: For the Alliance!
5645

57-
//* ****** EcmaScript 2015 (ES6): const (https://goo.gl/YUQj3r)
58-
const PI = 3.141593;
59-
// PI = 3.0; //throws error
60-
console.log(PI);
61-
62-
const jsFramework = {
63-
name: 'Angular'
64-
};
65-
jsFramework.name = 'React';
6646

67-
// error, cannot reassign object reference
68-
/*
69-
jsFramework = {
70-
name: 'Vue'
71-
};
72-
*/

0 commit comments

Comments
 (0)