I have a problem in interpreting the question,
read statement 1 which is,
1.Inside the fearMessage function expression, use conditional statements (e.g., if, else if) to check the integer value of the fear variable, assigned on line 1, and decide whether its value is LOW or MEDIUM.
And came up with code,
var fearMessage = function(fear) {
if (fear<200)
{return "LOW";
}
else if (fear>=200 && fear <=300)
{return "MEDIUM";
}
};
read statement 2, which is this,
2. For each fear range below we want to display a confirmation message with the corresponding message. We can return a call to the confirm function that has a single string argument containing the correct message.
and came up with code,
function confirmToGo(fearMessage)
{ if(fearMessage=="LOW")
alert("Fear Level: LOW \n Still wanna ride?");
else
alert("Fear Level: "+fearMessage+ "'\n Still wanna ride?");
}
Kindly guide me and tell me how is this wrong.
Thanks.