Javascript: Changing type of variable?

Posted by Warrantica on Stack Overflow See other posts from Stack Overflow or by Warrantica
Published on 2010-05-16T13:25:22Z Indexed on 2010/05/16 13:30 UTC
Read the original article Hit count: 176

Filed under:
|

Is there any way to change the type of variable from string to number?

For example, I have

var str = "1";

Can I change it to

var str = 1;

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about variable