Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does this mean?

Status
Not open for further replies.

pgr

IS-IT--Management
Feb 28, 2002
24
0
0
PT
Hi!

I'm not an expert on Javascript, can you tell what does the following code means:


( p1.length == a + 1 ) ? pass = base : false;


Thanks
 
It's shorthand for:
if the length of the string, p1, is equal to the value of a + 1, then the variable, pass, equals the variable, base; otherwise return "false".
or
Code:
if (p1.length==a+1) {
    pass=base;
} else {
    false;
}

_________________
Bob Rashkin
 
Its a conditional. An alternate way of writing an If statement. It reads:

If p1.length is equal to a+1 then pass equals base otherwise false

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top