-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq31.js
More file actions
23 lines (23 loc) · 849 Bytes
/
q31.js
File metadata and controls
23 lines (23 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"use strict";
// No Users: Add an if test to Exercise 28 to make sure the list of users is not empty.
// • If the list is empty, print the message We need to find some users!
exports.__esModule = true;
// • Remove all of the usernames from your array, and make sure the correct message is printed.
function q31() {
var usernames = []; // empty array
if (usernames.length === 0) {
console.log("We need to find some users!");
}
else {
usernames.forEach(function (username) {
if (username === 'admin') {
console.log("Hello admin, would you like to see a status report?");
}
else {
console.log("Hello ".concat(username, ", thank you for logging in again."));
}
});
}
}
exports["default"] = q31;
q31();