quote:
Originally posted by .2007
Were?
quote:
Originally posted by J-Thread
The only thing I see is that you're missing a closing bracket ( } ) of the function...
read underlined part carefully
In most programming languages you always must enclose a group of statements with some sort of character or other start/ending statement.
In JScript, when you start a group of statements with "{" you always must close the group with "}".
To avoid such mistakes it is almost mandatory to properly indent each line of code so you can easly see where you're missing some starting/closing character.
quote:
Originally posted by Eljay
=== is a perfectly valid operator, it does the same thing as the == operator with the addition of checking the type of the two variables being compared. (which in this case is not really needed, but wont make any difference)
yes and no... It is the other way around...
When you use === no additional type conversions are done. It is with the use of == that extra stuff is done. Hence I would personally always use === wherever possible. And I see == as a special case of ===, not the other way around.
But you're right that in this case it wont make a difference in the outcome of the function since both are strings already.
So it is == which wouldn't be realy needed.
Ref:
CookieRevised's reply to Nudges, Updated.