Link to home
Start Free TrialLog in
Avatar of tsmithinnc
tsmithinncFlag for United States of America

asked on

Javascript question

My son asked for help and I can't help him...
any ideas???

ROFL...I KNOW it frightens you that my offspring is learning this too...lol

var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3
function check(x)
{
        if (x.length == moo)
        {
                        alert("win!");
                        window.location += "?lvl_password="+x;
        } else {
                        alert("fail D:");
     }
}
Avatar of bdichiara
bdichiara
Flag of United States of America image

You'll have to be more specific. What is the objective here? What does this do? What do you need help with? Do you need an explanation as to what's going on here?
var foo = 5 + 6 * 7;
var bar = foo % 8;
var moo = bar * 2;
var rar = moo / 3;
function check(x)
{
        if (x.length == moo)
        {
                        alert("win!");
                        window.location += "?lvl_password="+x;
        } else {
                        alert("fail D:");
     }
}

you need ; after every statement?
Avatar of tsmithinnc

ASKER

I have no idea what it is doing...he says it is giving him 14, but ...
I told him the function is saying if the length of x is 14 then he will get a prompt saying win...
otherwise fail...

is that right???
ASKER CERTIFIED SOLUTION
Avatar of yossi_intlock
yossi_intlock

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial