-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnews.js
More file actions
119 lines (78 loc) · 2.43 KB
/
Copy pathnews.js
File metadata and controls
119 lines (78 loc) · 2.43 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// function alex(str) {
// let i = 1;
// while (i < 5) {
// i++;
// console.log("this is less than", i,);
// }
// }
// function showMsg(from, to, time, message) {
// console.log(from, to, time, message);
// }
// let date = new Date(). toLocaleString();
// showMsg("Alex", "John", date, "Hello John!");
// showMsg("John", "Alex", date, "Hi Alex!");
// showMsg("John", "John", date, "i'm fine!");
let header = document.getElementById("star");
let star = document.getElementById("star");
function addbtn(){
let star = document.getElementById("star");
star.style.backgroundColor = "orange";
star.style.color = "blue";
star.style.fontSize = "30px";
}
header.innerHTML = "UP LIVERPOOL";
alert("BENWORLD!");
console.log("star")
// for while loop
// let isRunning = true;
// let userInput = "martin"
// while (isRunning) {
// // Prompt the user for input
// // Handle the user input using a switch statement
// switch (userInput == "martin") {
// case "martin":
// console.log("The application has started.");
// break;
// default:
// console.log("Invalid command. Please enter 'start', 'stop', or 'exit'.");
// }
// }
// console.log("Application has exited.");
// Example 1: Using a for loop with a switch statement based on the loop index
// for (let i = 0; i < 5; i++) {
// switch (i) {
// case 0:
// console.log(i, 'is zero');
// break;
// case 1:
// case 2:
// case 3:
// console.log(i, 'is between one and three');
// break;
// case 4:
// console.log(i, 'is four');
// break;
// default:
// console.log(i, 'is out of range');
// }
// }
// Example 2: Using a for loop with a switch statement based on array elements
// const fruits = ['apple', 'banana', 'cherry', 'date'];
// for (let j = 0; j < fruits.length; j++) {
// switch (fruits[j]) {
// case 'apple':
// console.log('Apple is red.');
// break;
// case 'banana':
// console.log('Banana is yellow.');
// break;
// case 'cherry':
// console.log('Cherry is red.');
// break;
// case 'date':
// console.log('Date is brown.');
// break;
// default:
// console.log('Unknown fruit.');
// }
// }