diff --git a/chapter 4 code b/chapter 4 code index 1bf19eb..be25e28 100644 --- a/chapter 4 code +++ b/chapter 4 code @@ -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);