Welcome visitor
* Login
* Register
It is currently March 23rd, 2019, 8:28 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  adding 2 variables
PostPosted: August 7th, 2009, 3:34 pm 

Posts: 27
why if i try to add 2 variables with numbers as values it always puts the numbers together no arithmetical operation made?

sorry for this simple question but it is driving me crazy.


Top
 Profile  
 
  Re: adding 2 variables
PostPosted: August 7th, 2009, 3:51 pm 

Posts: 57
convert them to numbers by using the Number() function
alert(Number(x)+Number(y);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron