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!!!

Follow me

Abhishek Gupta

I am Abhishek from Lucknow (India). I have been working as a software engineer from last 6+ years, and its my passion to learn new things and implement them as a practice.
Follow me

Latest posts by Abhishek Gupta (see all)

One Reply to “Javascript Mission 4: Var?”

Leave a Reply