View Single Post
Old 12-12-2012, 01:23 PM   PM User | #1
123jo
New Coder

 
Join Date: Dec 2012
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
123jo is an unknown quantity at this point
Question How to go through a table using recursivity?

Hi guys, I need to convert a table of strings numbers (like 10x4+5x2+...) into one integer using recursivity.
I need to change that kind of code:

Code:
for(var i=0; i<myArray.length; i++) { 
myArray[i] = parseInt(myArray[i], 10);
}
for something using recursivity (no loops) to go through every entries of my table. Can you help me?

(The code isn't complete, I know I have to use if charAt(i) == "x" or if charAt(i) == "+")

Thanks!

Last edited by 123jo; 12-12-2012 at 02:30 PM..
123jo is offline   Reply With Quote