AnsweredAssumed Answered

Iterating collections

Question asked by michaelc on Jul 3, 2013
Latest reply on Jul 3, 2013 by michaelc
having all sorts of problems with the backend JavaScript, it's not the JavaScript I know.

So the method I have used to iterate a collection are not working for me.

   for ( var i=0; i<context.properties.section.sections.length;i++){     
        x = context.properties.section.sections;    
   }

this does not fail, but it does not work.
I dumped context.properties.section.sections.length I expected it to be an int.
but it seems to be an object.

org.mozilla.javascript.Undefined@63a65974

So this should be javascript 101 but I don't seem to be getting it.
how do I iterate a collocation in backend javascript.
#list will do it in the freemaker.

Outcomes