From da5ef8817db790de6ca8f4ff52af574fa8554b5e Mon Sep 17 00:00:00 2001 From: LSvekis Date: Wed, 9 Jun 2021 18:08:17 -0400 Subject: [PATCH] Update chapter 4 code --- chapter 4 code | 10 ++++++++++ 1 file changed, 10 insertions(+) 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);