199
rated 0 times
[
200]
[
1]
/ answers: 1 / hits: 25520
/ 13 Years ago, sun, march 11, 2012, 12:00:00
Is there any way to use typed variables in javascript? Like integer, string, float...
More From » javascript
Is there any way to use typed variables in javascript? Like integer, string, float...
JavaScript variables are not typed.
JavaScript values are, though. The same variable can change (be assigned a new value), for example, from uninitialized to number to boolean to string (not that you'd want to do this!):
var x; // undefined
x = 0; // number
x = true; // boolean
x = hello; // string