-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexampl.js
More file actions
65 lines (53 loc) · 1.26 KB
/
exampl.js
File metadata and controls
65 lines (53 loc) · 1.26 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
class alphaMale {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
sayName() {
console.log(`${this.firstName} ${this.lastName}`);
}
}
class Blogger {
constructor(firstName, lastName, canal) {
this.firstName = firstName;
this.lastName = lastName;
this.canal = canal;
}
sayName() {
console.log(`Канал: ${this.canal} [автор канала: ${this.firstName}
${this.lastName}]`);
}
}
let blogger = new Blogger("Сигизмунд", "Хотелкин", "Хотеть не вредно");
blogger.sayName();
let car = {
color: "red",
drivers: ["Иван", "Сергей", "Алексей", "Петр"],
getDrivers: function (inlex) {
console.log("Водитель " + this.drivers[inlex]);
},
open() {
console.log("открыл свое корыто");
}
};
let array = [
1,
" сегодня ",
" хорошая ",
" погода ",
" я ",
" один ",
{
color: "red"
}
];
car.getDrivers(0);
car.open();
console.log(array[6]);
for (let i = 0; i < car.drivers.length; i++) {
console.log(car.drivers[i]);
}
console.log("==========================");
for (let i = car.drivers.length - 1; i >= 0; i--) {
console.log(car.drivers[i]);
}