Update chapter 4 code
This commit is contained in:
parent
d4e0d2b8ca
commit
da5ef8817d
@ -262,3 +262,13 @@ switch (person) {
|
||||
console.log(message);
|
||||
|
||||
*/
|
||||
|
||||
const userNames = ["Mike", "John", "Larry"];
|
||||
const userInput = "John";
|
||||
let htmlOutput = "";
|
||||
if (userNames.indexOf(userInput) > -1) {
|
||||
htmlOutput = "Welcome, that is a user";
|
||||
} else {
|
||||
htmlOutput = "Denied, was not a usernot true ";
|
||||
}
|
||||
console.log(htmlOutput + ":, " + userInput);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user