-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.html
43 lines (35 loc) · 922 Bytes
/
variables.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<title>Variables</title>
</head>
<body>
<script>
/*
We learned about:
- Rules for naming variable
- Rules for re-assigning variable
- 3 ways of creating a variable:
- const by default
- let, if we have to change a variable
- var, the older ways. Don't use it!
*/
let variable1 = 3;
console.log(variable1);
const calculation = 2 + 2;
console.log(calculation);
console.log(calculation + 2);
const result = calculation + 2;
console.log(result);
const message = 'hello';
console.log(message); console.log(';');
variable1 = 5;
console.log(variable1);
variable1 = variable1 + 1;
console.log(variable1);
const variable2 = 3;
var variable3 = 3;
console.log(typeof variable2)
</script>
</body>
</html>