You guys have all been fantastic and I sincerely appreciate your assistance. I'm curious as to why this wouldn't work the same with the above example? I was thinking there may have been something in the function that caused the for loop to stop early, but I can't really see anything that would cause that sort of behavior. When I did this, the for loop output each element in the stringBase array one at a time, which is what I expected. I changed your original function just to include a console.log vs a return statement (either didn't seem to make much of a difference) and I tested that for loop to output the currentChar variable to the console to make sure it worked. In the console, it just runs the first item then doesn't output any further. The trouble is that the function doesn't run for each item in the array as expected. Var stringBase = įor (var i = 0 i < stringBase.length i ++)
0 Comments
Leave a Reply. |