You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Week1/LESSONPLAN.md
+93-12Lines changed: 93 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -18,17 +18,20 @@ The purpose of this class is to introduce to the student:
18
18
#### 1. The 2 types of websites: static vs. dynamic
19
19
20
20
##### Explanation
21
+
21
22
Static websites usually come with a fixed number of pages that have a specific layout. When the page runs on a browser, the content is literally static and doesn’t change in response to user actions. A static website is usually created with HTML and CSS
22
23
Compared to static websites, which are purely informational, a dynamic website is more functional. It allows users to interact with the information that is listed on the page. Of course, that requires utilizing more than just HTML code.
Discuss in class which claim belongs to wich type of website:
33
+
34
+
Discuss in class which claim belongs to which type of website:
32
35
33
36
Content of Web pages can not be change at runtime.
34
37
Server side languages such as PHP, Node.js are used.
@@ -44,7 +47,8 @@ Discuss in class which claim belongs to wich type of website:
44
47
Same content is delivered everytime the page is loaded.
45
48
46
49
##### Essence
47
-
[In the link is an article with (dis)advantages of both static and dynamic websites.](https://www.spiderwriting.co.uk/static-dynamic.php)
50
+
51
+
[In the link is an article with (dis)advantages of both static and dynamic websites.](https://www.spiderwriting.co.uk/static-dynamic.php)
48
52
49
53
Static:
50
54
Advantage:
@@ -67,23 +71,34 @@ _Show examples of static and dynamic websites_
67
71
#### 2. The pillars of web development: HTML/CSS/JavaScript
68
72
69
73
##### Explanation
74
+
70
75
- HTML defines what the content is.
71
76
- CSS defines the appearance of the page.
72
77
- JavaScript defines behavior of the page.
73
78
74
79
##### Example
80
+
75
81
- An example about relationship between HTML, CSS and Javascript using a methaphor of building a city: https://blog.codeanalogies.com/2018/05/09/the-relationship-between-html-css-and-javascript-explained/
76
82
77
83
##### Exercise
78
-
84
+
85
+
Let students create a classwork directory and create an index.html along with an app.js. Script tag should be added to the end of body tag(reason for doing so is part of JS2 Week1).
86
+
87
+
The end result should look like:
88
+
89
+
```
90
+
- js1-week1-classwork
91
+
- index.html
92
+
- app.js
93
+
```
94
+
79
95
##### Essence
80
-
Up until now at HackYourFuture, we have been writing websites using HTML and CSS.
81
-
Even though a website written with these two languages works just fine, it is only a static page.
82
96
83
-
These static pages can interact with a visitor only through the use of forms. Once a form is filled out and submitted,
84
-
a request is sent back to the server where a new static web page is constructed and eventually downloaded into the browser.
97
+
Up until now at HackYourFuture, we have been writing websites using HTML and CSS. Even though a website written with these two languages works just fine, it is only a static page.
98
+
99
+
These static pages can interact with a visitor only through the use of forms. Once a form is filled out and submitted, a request is sent back to the server where a new static web page is constructed and eventually downloaded into the browser.
85
100
86
-
The big disadavantage of web pages like this is that the only way that a visitor has of interacting with the page is by filling out the form and waiting for a new page to load.
101
+
A big disadavantage of web pages like this is that the only way that a visitor has of interacting with the page is by filling out the form and waiting for a new page to load.
87
102
88
103
It doesn't exhibit any dynamic behaviour like:
89
104
@@ -96,14 +111,80 @@ It doesn't exhibit any dynamic behaviour like:
96
111
97
112
##### Explanation
98
113
99
-
**Do Exercise**
114
+
In JavaScript, there are three ways of creating variables.
115
+
116
+
- var
117
+
- let
118
+
- const
119
+
120
+
While `var` has been used in JavaScript for a long period of time, `let` and `const` are recent additions having been introduced in ES6.
121
+
122
+
Three different stages of working with variables are:
123
+
124
+
- Variable Declaration
125
+
- Declaration means creating a variable and providing it with a name. During the whole program, a variable can be declared only once.
126
+
- Variable Initialization
127
+
- Initialization is declaring a variable and assigning it an initial value at the time of declaration. By default, all variables created in JavaScript have undefined as the default value unless explicitly given a different value.
128
+
- Variable (Re)Assignment
129
+
- Variable assignment means throwing away the old value of a variable and replacing it with a new one. Initialization can be thought of as a special way of assignment.
130
+
131
+
##### Example
132
+
133
+
```javascript
134
+
// Variable Declaration
135
+
var firstName;
136
+
let lastName;
137
+
constage; // is this correct???
138
+
139
+
console.log(firstName);
140
+
console.log(lastName);
141
+
console.log(age);
142
+
```
143
+
144
+
```javascript
145
+
// Variable Initialization
146
+
var firstName ='Yash';
147
+
let lastName ='Kapila';
148
+
constage=29;
149
+
150
+
console.log(firstName);
151
+
console.log(lastName);
152
+
console.log(age);
153
+
```
154
+
155
+
```javascript
156
+
var firstName ='Tom';
157
+
let lastName ='Hanks';
158
+
159
+
console.log(firstName);
160
+
console.log(lastName);
161
+
162
+
// Assigning variables to a different value
163
+
firstName ='Hanks';
164
+
lastName ='Tom';
165
+
166
+
console.log(firstName);
167
+
console.log(lastName);
168
+
```
169
+
170
+
##### Exercise
171
+
172
+
TODO(Could be moved to SECOND HALF)
173
+
174
+
##### Essence
175
+
176
+
Any application written in any programming language requires data or information to work with. This information can be as simple as a string, number or complex types like a list of strings, a mix of strings and numbers etc.
177
+
178
+
For eg, you name and age are simple pieces of information, strings and a number respectively. On the other hand, your house address could be considered as a complex set of information including house number, street name, city, postcode and country.
179
+
180
+
Variables are simply named storage/pointer for this information.
100
181
101
182
### SECOND HALF (14.00 - 16.00)
102
183
103
184
#### 4. The basic data types (string, boolean, number, undefined, null)
0 commit comments