-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpro30.js
18 lines (17 loc) · 816 Bytes
/
pro30.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*Hello Admin: Make a array of five or more usernames, including the name 'admin'.
Imagine you are writing code that will print a greeting to each user after they log in to a website.
Loop through the array, and print a greeting to each user:
• If the username is 'admin', print a special greeting, such as Hello admin, would you like to see a status report?
• Otherwise, print a generic greeting, such as Hello Eric, thank you for logging in again.
*/
let users = ["admin", "user1", "user2", "user3", "user4"];
for (let i = 0; i < users.length; i++) {
let usernames = users[i];
if (usernames == "admin") {
console.log("Hello admin, would you like to see a status report?");
}
else {
console.log("Hello " + usernames + ", thank you for logging in again.");
}
}
export {};