Yes, 2 is the number of elements that commands contains. They happen to be arrays. Specifically the elements are:
the array ["commands", "new", "ls"]
and the array [" - Lists current...
Type: Posts; User: pbrockway2
Yes, 2 is the number of elements that commands contains. They happen to be arrays. Specifically the elements are:
the array ["commands", "new", "ls"]
and the array [" - Lists current...
The for loop does what you'd expect - it increments until the condition part becomes false.
What you didn't do in your debugging code was print the actual array length you are using:...
The output you posted suggests that you are going around the loop two times while I imagine that you want to go around the loop three times.
It is important to bear in mind that three are three...