-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson3-4.html
More file actions
88 lines (68 loc) · 1.95 KB
/
lesson3-4.html
File metadata and controls
88 lines (68 loc) · 1.95 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Getting Started wiht JAVA Script</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
</head>
<body>
<script>
//String
'this is my string';
'my second string';
"else one string";
console.log(Boolean(''));
//objects - like dictionary in Python
const user = {
name: 'Chris',
username: 'chriscode'
};
//array - like list in Python
const users = ['chris', 'nick', 'holly'];
//something heavy
const superUser = [
{name: "name Zero"},
{name: "name One"},
{name: "name Two"}
]
console.log(users[0]);
console.log(superUser[1]['name']);
//declaring variables
var thing = 'first'; // depricated for the future
const otherThing = 'second'; //it could not be reassigned
let newThing = 'third'
newThing = "New value for let declared variable"
const a = 10;
b = 3;
c = 15;
e = 'my name'
d = 'Alx'
console.groupCollapsed("SomeGroup");
console.log(a+b);
console.log(e + ' ' + d);
console.log(typeof(a+d))
console.groupEnd();
const x = 'one';
const y = 'one';
const z = 'ONE'
let numb = 10;
let str = '10';
let smth;
let the = null;
console.groupCollapsed('Comparisions')
console.log(x == y);
console.log(x == z);
console.log(x == z.toLowerCase());
console.groupEnd();
console.groupCollapsed('compare string and number');
console.log(numb == str);
console.log(numb === str);
console.log(numb != str);
console.log(numb !== str);
console.groupEnd();
console.groupCollapsed('undefined');
console.log(smth == the);
console.groupEnd();
</script>
</body>
</html>