diff --git a/Challenges/Week2/app.js b/Challenges/Week2/app.js index 146acc5..c4da6fb 100644 --- a/Challenges/Week2/app.js +++ b/Challenges/Week2/app.js @@ -1,8 +1,19 @@ -//create function - //control and return statements -//Prompt user for input and store variable +function processInput(message) +{ + if(message === "hello") + { + return ("Hello World!"); + } + else { + return("You didn't say hello :("); + } +} -//Call function +var userInput; -//Alert user results +userInput = prompt(); + +var response = processInput(userInput); + +console.log(response); \ No newline at end of file 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 @@