Just to be clear, because it seems like there was a misunderstanding, or at 
least reading through the thread makes it hard to realize the actual issue here:

The for loop issue wasn't something specific to Rhino, it was just a JS syntax 
error.

You can see the examples of how to use the Iterator() function on this page:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator

The correct syntax (for JS language, not Rhino specifically) is

    for (var [name, value] in Iterator(a)) {
        //do the stuff
    }


Thanks,
Jordan Shurmer

-----Original Message-----
From: lancedolan [mailto:lance.do...@gmail.com] 
Sent: Wednesday, January 11, 2017 4:42 PM
To: users@sling.apache.org
Subject: RE: JS Use API usability or limitations

No architectural reason - purely speed of development reasons. Our team has 
switched from Java to Node.js on our other projects and are seeing real gains 
in dev time. We believe we could see the same faster development with 
lightweight JS files as opposed to traditional type-safe Java.

I think this is a popular opinion amongst developers, that JS is faster to 
write in than Java? The question currently on the table is whether the 
difficulty in debugging esoteric Rhino interactions will negate that speed, in 
which case we might as well stick to Java and enjoy stability of type safety. 



--
View this message in context: 
http://apache-sling.73963.n3.nabble.com/JS-Use-API-usability-or-limitations-tp4069490p4069526.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Reply via email to