Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Javascript only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
Javascript
How to add 1 in the array?
How to add 1 in the array?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
wish
New Member
Join Date:
May 2007
Posts:
65
#1
How to add 1 in the array?
Oct 10 '07, 04:06 AM
Let say myArray[0]=98 then i want add 1 to equal 99?
How?
I try myArray[0]+1 but fail..output is like this 981.. :-(
can someone help?
dmjpro
Top Contributor
Join Date:
Jan 2007
Posts:
2476
#2
Oct 10 '07, 04:15 AM
Originally posted by
wish
Let say myArray[0]=98 then i want add 1 to equal 99?
How?
I try myArray[0]+1 but fail..output is like this 981.. :-(
can someone help?
[code=javascript]
myArray[0]=98;
var c = myArray[0]+1; //c will be 99
[/code]
I think you assign "98" .... anyway, you can do it "parseInt(myArr ay[0])+1"
Debasis Jana
Comment
Post
Cancel
wish
New Member
Join Date:
May 2007
Posts:
65
#3
Oct 10 '07, 05:31 AM
Thank you .....i done it.
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment