How to declare integer variable in JavaScript

{0 Comments}

As you want to declare integer variable in JavaScript then you can declare this in default manner.  var varname=  1; like that. But when this is need to sure that the variable declared here is integer or not then you can use following syntax have declare integer variable in JavaScript.

 Javascript |  copy code |? 
1
var a = arg;
2
 
3
            var so=parseInt(a);

Leave a Comment

Your email address will not be published.