Search
 
SCRIPT & CODE EXAMPLE
 

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]
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to wait until a variable is set javascript 
Javascript :: angular new formcontrol default value 
Javascript :: convert a string to a number in javascript 
Javascript :: generate 50 random numbers between 1 and 500 in javascript 
Javascript :: transform javascript 
Javascript :: javascript dedupe array 
Javascript :: jquery key enter events 
Javascript :: set image as background react 
Javascript :: javascript function convert bytes into mb 
Javascript :: check if file is empty javascript fs 
Javascript :: xml http request 
Javascript :: convert array string to number 
Javascript :: electron js development auto refresh 
Javascript :: GET req with js 
Javascript :: how to update a json file javascript 
Javascript :: /on in jquery 
Javascript :: react check if in mobile 
Javascript :: invalid time value react datepicker 
Javascript :: javascript object destructuring rename 
Javascript :: date split in javascript 
Javascript :: Append element to a different parent 
Javascript :: convert json string to json object in java 
Javascript :: compare and filter two array of object 
Javascript :: settime out with promise 
Javascript :: laravel query json 
Javascript :: js check window active 
Javascript :: js transition 
Javascript :: jquery get all checkbox checked 
Javascript :: push-method-in-react-hooks-usestate 
Javascript :: find the max length of string elements in an array 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =