Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add variable numerically in javascript

//use parseFloat(x); to change string to number
a=10;
b=20;
console.log(parseFloat(a)+parseFloat(b));//this will give a+b=30
//while
consle.log(a+b); //will give a+b=1020 [as String]
 
PREVIOUS NEXT
Tagged: #add #variable #numerically #javascript
ADD COMMENT
Topic
Name
1+1 =