-
Notifications
You must be signed in to change notification settings - Fork 348
Expand file tree
/
Copy pathzadanie02.js
More file actions
78 lines (73 loc) · 1.11 KB
/
zadanie02.js
File metadata and controls
78 lines (73 loc) · 1.11 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
// //Twój kod
//
// setTimeout(()=>{
// console.log("Node.js")
// },4000);
//
// setTimeout(()=>{
// console.log("się")
// },1000);
//
// setTimeout(()=>{
// console.log("Witam")
// },);
//
// setTimeout(()=>{
// console.log("i korzystam")
// },6000);
//
// setTimeout(()=>{
// console.log("z funkcji czasu")
// },7000);
//
// setTimeout(()=>{
// console.log("z")
// },2000);
//
// setTimeout(()=>{
// console.log("programem")
// },3000);
//
const sec = 1000;
const array = [
{
txt: 'Node.js',
time: 4,
},
{
txt: 'się',
time: 1,
},
{
txt: 'Witam',
time: 0,
},
{
txt: 'i korzystam',
time: 6,
},
{
txt: 'w konsoli',
time: 5,
},
{
txt: 'z funkcji czasu!',
time: 7,
},
{
txt: 'z',
time: 2,
},
{
txt: 'programem',
time: 3,
},
];
array.forEach(el => {
pokaz_text(el)
});
function pokaz_text(obj){
setTimeout(()=>{
console.log(obj.txt)
},obj.time * sec);
}