And inside of the for loop, you shouldn't be modifying the variable position as it is what's used to control the iterations.

Adding a string to a number turns it into a string, making it impossible to add or subtract from. The position + 1 + " " will always produce undesirable results.

frankenstein

09-05-2010, 11:13 PM

And inside of the for loop, you shouldn't be modifying the variable position as it is what's used to control the iterations.

Adding a string to a number turns it into a string, making it impossible to add or subtract from. The position + 1 + " " will always produce undesirable results.

What do you mean by this?

I am very new.

Do you mean i should assign a new variable, and use that instead?

wildreason

09-05-2010, 11:51 PM

Yeah inside your for loop just change the name of the variable since it's already being used for the loop iteration. So positionMsg or something. Just so that it doesn't interfere with the for loop iterating.

frankenstein

09-06-2010, 05:57 PM

Yeah inside your for loop just change the name of the variable since it's already being used for the loop iteration. So positionMsg or something. Just so that it doesn't interfere with the for loop iterating.

function showTimetable()
{

for (var position = 0; position < flightTimes.length; position = position + 1 ) {