Javascript Mission 4: Var?

This mission is really simple. After checking out the source code you will come to know it.

RawrRawr = "moo";
function check(x)
{
    "+RawrRawr+" == "hack_this_site"
    if (x == ""+RawrRawr+"")
    {
	alert("Rawr! win!");
        window.location = "../../../missions/javascript/4
/?lvl_password="+x;
    } else {
	alert("Rawr, nope, try again!");
    }
}

In the first line, variable RawrRawr has the value ‘moo’. Then in the function their is a weird command “+RawrRawr+” == “hack_this_site”, which is just to confuse you, so don’t worry. And you will also find that, like every other mission by now, this one too takes the value entered and passes it to function check and compares it with RawrRawr which still has the value ‘moo’.

Note: ‘+’ in javascript is used to concatenate two strings. So when we write “”+RawrRawr+””, we are just concatenating two empty strings with RawrRawr and compare it to user input. So the answer is still the same, moo.

Good luck!!!

One Reply to “Javascript Mission 4: Var?”

Leave a Reply