|
Hi i wonder if anyone can help, I'm trying to write a program in JS to add the elements of two arrays together - ie firstArray = [1,2,3,4,5,6,7,8,9] secondArray = [2,3,4,5,6,7,8,9,10]...........I need to know how to add the first element in firstArray to the first element in secondArray and display the result. I have the data in the arrays already and have writen this:- but I do not know how to add the elements together, I thought of putting:- totalVotesArray = ((onlineVotesArray) + (paperVotesArray)); but that does not work - help please!
(comments are locked)
|
The question has been closed Jun 02 '11 at 02:00 PM by Eric5h5 for the following reason:
Off-topic
|
Before your for-loop initialize the array to have the correct size: In your for-loop just add the arrays on a per-element-basis:
(comments are locked)
|

This doesn't appear to be a Unity question, so next time I suggest asking it at http://stackoverflow.com/ which has the additional advantage of being a much larger community, so it is more likely you'll get more/quicker/better answers