Does a Timed Loop count as a form of iteration for the AP Create PT?

Does a Timed Loop count as a form of iteration for the AP Create PT?

I was thinking yes because it iterates until a condition is met, however, I’m not 100% certain.



To be on the safe side, I would use a loop like for loop or while loop. But, I would caution you that you are not allowed to tell the student whether you feel the timedLoop would count. You can certainly ask them if they think it should count, but providing guidance of any kind is strictly not allowed.

Greetings @nick.bahr,

as per your inquiry a timedLoop could count as an iterator, However trying to make a case that it does iterate will be much more challenging for a student to prove at least over using conventional means. In order to explain what i mean it may be able to show better with an example

var array = [1,2,3,4,7,8,21];
// lets start with a conventional statement
for(var i = 0; i < array.length; i++) {
// now for the more unconventional iterator
var i = 0; // needs a seperate iterator outside
var iterator = setInterval(function(){ // needs an id to stop iterating
 if(i < array.length-1) {
 } else {
  clearInterval(iterator); // more work that is already implicity done by the for loop 

as per my definition of an iterator it must have a start and stop point along with a progress tracker of where it is in the current loop, weather it be an index or an element, the second one uses a lot more steps to do what an implicit for loop is doing you can also use while or the do while loop though these may require more steps to get an iterator setup they’ll do the job better here. Recently, thanks to @jdonwells I’ve picked up another trait to my personal best practices. What is most important above all is intent using clear instructions takes much less time to understand and explain to get someone up to speed weather your on a team or asking for help.

Anyways hope this answers your question

Best, Varrience