diff --git a/Challenges/Week2/app.js b/Challenges/Week2/app.js index 146acc5..3f1d70f 100644 --- a/Challenges/Week2/app.js +++ b/Challenges/Week2/app.js @@ -1,3 +1,4 @@ + //create function //control and return statements @@ -6,3 +7,23 @@ //Call function //Alert user results + +function processInput(message) +{ + if(message === "Hello!") + { + return("Hello World!"); + } + else { + return("You didn't say hello :("); + } +} + +var userInput; +var response; + +userInput = prompt(); + +response = processInput(userInput); + +alert(response); diff --git a/Challenges/Week2/index.html b/Challenges/Week2/index.html index afe8e37..2f1bae7 100644 --- a/Challenges/Week2/index.html +++ b/Challenges/Week2/index.html @@ -15,6 +15,6 @@