Update chapter 4 code

This commit is contained in:
LSvekis 2021-06-09 18:08:17 -04:00 committed by GitHub
parent d4e0d2b8ca
commit da5ef8817d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);