-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
61 lines (61 loc) · 1.14 KB
/
script.js
File metadata and controls
61 lines (61 loc) · 1.14 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
// Exercise 1
let z = 10;
alert(a);
z = 20;
alert(a);
// Exercise 2
let info = "First Iphone date release";
alert(info);
const year = "2007";
alert(year);
// Exercise 3
let info = "JavaScript inventor";
alert(info);
const inventor = "Brendan Eich";
alert(inventor);
// Exercise 4
let y = 2;
let x = 10;
let resultAdd = x + y;
let resultSub = x - y;
let resultDiv = x / y;
let resultMult = x * y;
alert(resultAdd);
alert(resultSub);
alert(resultDiv);
alert(resultMult);
// Exercise 5
let c = 2;
let d = 5;
let result = c ** d;
alert(result);
// Exercise 6
let a = 9;
let b = 2;
alert(a % b);
// Exercise 7
let num = 1;
num += 5;
num -= 3;
num *= 7;
num /= 3;
++num;
--num;
alert(num);
// Exercise 8
let age = prompt("Сколько вам лет?");
alert(age);
// Exercise 9
const user = {
nickname: "Dima",
age: 24,
isAdmin: true,
};
user.age = 17;
user["city of residence"];
delete user["city of residence"];
const info = prompt("Какую информацию хотите узнать о пользователе?");
alert(user.info);
// Exercise 10
let nickname = prompt("Как к Вам обращаться?");
alert("Привет, " + nickname "!");