Use of a for loop for non existent data in array?

Hello! Haven’t quite finished the for loop section yet. I really just clicked through it for knowledge while waiting the last 5 minutes before class started at the college. I am wondering why a for loop was used instead of something like catch(e:error) that would be used in AS3. If you have code you know should be functioning and user input can purposely be outside of parameters or in this case our array data, then wouldn’t a catch for the error so it can log the error to us on debugging runs or just catch it so it does nothing. It could be a better use/easier for students to learn than for loops this early. Just an idea and I have no idea about C#, so I’m sorry if I sound like a fool.

@ Rick_Davidson

Privacy & Terms