diff --git a/Challenges/Week2/app.js b/Challenges/Week2/app.js index 146acc5..1aa2f9c 100644 --- a/Challenges/Week2/app.js +++ b/Challenges/Week2/app.js @@ -3,6 +3,29 @@ //Prompt user for input and store variable +function processInput(message) +{ + + console.log(message); + + if(message == 'Hello!') + { + return('Hello world!'); + + } else { + return("You didn't say hello :("); + } +} + +var userInput; + +userInput = prompt(); + +var response = processInput(userInput); + +console.log(response); + + //Call function //Alert user results diff --git a/Challenges/Week2/index.html b/Challenges/Week2/index.html index afe8e37..ff72f2d 100644 --- a/Challenges/Week2/index.html +++ b/Challenges/Week2/index.html @@ -15,6 +15,7 @@