diff --git a/Challenges/Week2/app.js b/Challenges/Week2/app.js index 146acc5..75b7a6c 100644 --- a/Challenges/Week2/app.js +++ b/Challenges/Week2/app.js @@ -1,8 +1,11 @@ -//create function - //control and return statements +function hello(input){//create function + if(input==="Hello") + return "Hello World!"; + else return "Incorrect input!"; +}//control and return statements -//Prompt user for input and store variable +var user_enter=prompt("Please enter a word!");//Prompt user for input and store variable -//Call function +var i=hello(user_enter);//Call function -//Alert user results +alert(i);//Alert user results 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 @@