diff --git a/Challenges/Week2/app.js b/Challenges/Week2/app.js index 146acc5..b81ef31 100644 --- a/Challenges/Week2/app.js +++ b/Challenges/Week2/app.js @@ -1,8 +1,15 @@ //create function +function Hello(value) { //control and return statements - -//Prompt user for input and store variable - -//Call function - + if(value == 'Hello') + { + return "Hello world!" + } + else{ + return "You didn't say hello :(" + } +} +//Prompt user for input and store variable and call function +var userInput = prompt("Type 'Hello'") //Alert user results +alert(Hello(userInput)); \ No newline at end of file diff --git a/Challenges/Week2/index.html b/Challenges/Week2/index.html index afe8e37..5877a87 100644 --- a/Challenges/Week2/index.html +++ b/Challenges/Week2/index.html @@ -11,10 +11,10 @@