Skip to content

Commit f4e3adc

Browse files
committed
renamed files
1 parent d665cf6 commit f4e3adc

8 files changed

+20
-10
lines changed

chapter01/04-ConditionalStatements.html chapter01/06-ConditionalStatements.html

+1-1
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="04-ConditionalStatements.js"></script>
8+
<script type="text/javascript" src="06-ConditionalStatements.js"></script>
99
</body>
1010
</html>

chapter01/04-ConditionalStatements.js chapter01/06-ConditionalStatements.js

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/* Example 01 - if */
22
var num = 1;
3-
if (num == 1) {
3+
if (num === 1) {
44
console.log("num is equal to 1");
55
}
66

77
/* Example 02 - if-else */
88
var num = 0;
9-
if (num == 1) {
9+
if (num === 1) {
1010
console.log("num is equal to 1");
1111
} else {
1212
console.log("num is not equal to 1, the value of num is " + num);
1313
}
1414

1515
/* Example 03 - if-else-if-else... */
1616
var month = 5;
17-
if (month == 1) {
17+
if (month === 1) {
1818
console.log("January");
19-
} else if (month == 2){
19+
} else if (month === 2){
2020
console.log("February");
21-
} else if (month == 3){
21+
} else if (month === 3){
2222
console.log("March");
2323
} else {
2424
console.log("Month is not January, February or March");
@@ -38,4 +38,14 @@ switch(month) {
3838
break;
3939
default:
4040
console.log("Month is not January, February or March");
41-
}
41+
}
42+
43+
/* Example 05 - ternary operator - if..else */
44+
if (num === 1){
45+
num--;
46+
} else {
47+
num++;
48+
}
49+
50+
//is the same as
51+
(num === 1) ? num-- : num++;

chapter01/05-Loops.html chapter01/07-Loops.html

+1-1
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="05-Loops.js"></script>
8+
<script type="text/javascript" src="07-Loops.js"></script>
99
</body>
1010
</html>
File renamed without changes.

chapter01/06-Functions.html chapter01/08-Functions.html

+1-1
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="06-Functions.js"></script>
8+
<script type="text/javascript" src="08-Functions.js"></script>
99
</body>
1010
</html>
File renamed without changes.

chapter01/07-ObjectOrientedJS.html chapter01/09-ObjectOrientedJS.html

+1-1
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="07-ObjectOrientedJS.js"></script>
8+
<script type="text/javascript" src="09-ObjectOrientedJS.js"></script>
99
</body>
1010
</html>
File renamed without changes.

0 commit comments

Comments
 (0)