I am getting an issue saying 'for each is only available in Mozilla JavaScript extensions (use moz option)'. I am trying to add rows to my infotable using data being pulled in from a JSON file.
If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
tl;dr Use for(var i = 0..... as @slangley suggests.
ThingWorx infotables look like JavaScript arrays, but they are not. You can use forEach and its friends, but to do it you have to wrap infotable rows into js Array explicitly like that:
var nativeArray = Array.from(myInfotable);
Here's a very useful (!) example of this technique, which randomly disables half of your GenericThings:
That looks cool, but apparently it requires some data copying (sadly Rhino !== V8) and thus works slower than for-based approach straight from ALGOL. I don't remember the right figures, but for me it was something like twice slower, on that scale.