[Javascript] type casting...

Walter Torres walter at torres.ws
Sat Jun 28 03:22:51 CDT 2003


> -----Original Message-----
> From: javascript-bounces at LaTech.edu
> [mailto:javascript-bounces at LaTech.edu]On Behalf Of Tim Makins
> Sent: Saturday, June 28, 2003 2:56 AM
> To: [JavaScript List]
> Subject: Re: [Javascript] type casting...
>
>
> To change a string to a number, I use this:
>
> foo = foo - 0;

Almost the same diffeence as his multiply by ONE.

Does the same thing


> HTH Tim in Ireland.
> PS What on earth does your subject line mean ?

It means he's used to "real" programming languages that need to be told,
upfront, what kind of value will be stored in a particular variable.

In Java or C++ he would net need to ask this question becuase he would have
told the compiler that 'endMinutes' is an INTEGER and all would be right
with the world.

Thats what TYPE CAST means.

jsWalter




More information about the Javascript mailing list