May 2, 2002 - The Risk of Un-typed Variables
May 2, 2002|
The Risk of Un-typed Variables
Tips: May 2002
Yehuda Shiran, Ph.D.
What do you think the value of
var x, y, z; x = "2"; y = 2; z = x + y;
zwill be? Since we did not declare the types of
y, the compiler casts one of them to the other. In the case above,
22. The variable
yis casted to
Stringand concatenated with
To learn more on JScript .NET, go to Column 108, JScript .NET, Part II: Major Features.