Jelly: Basics, on the Way to Jelly Ninja-hood...
Test
three times. The reason it doesn't necessarily look like a programming language is all the stuff they had to do to make it possible to express this "program" in an XML document.
Take the first line, for example. In JavaScript, var jvar_loopCount = 0; works very well — but for XML, not so much. The Jelly designers translated that into a set tag (to indicate that we're setting a variable to some value) with a var attribute to name the variable we're setting, and a value attribute to indicate what value we're setting it to.
The other lines are similarly more familiar programming language constructs translated into a form that can be expressed in XML. Understanding this is crucial to understanding how Jelly works — it's worth some practice, which will make it much easier for you to look at (and make sense of!) Jelly templates. Also, just like other programming languages, the use of whitespace (especially for indentation) helps make Jelly templates understandable. I could have written the Jelly and JavaScript like this:
<j:set/> <j:while>Test <j:set/></j:while>
var jvar_loopCount = 0; while (jvar_loopCount < 3) {output('Test'); jvar_loopCount = jvar_loopCount + 1;}
But I sure find it easier to read and understand it the way I first wrote it!
Enough basics for now. If you'd like to investigate further, here is the online documentation for the standard Jelly tags we used: jelly, set, and while.
Tomorrow: one step closer to Jelly ninja-hood!
https://www.servicenow.com/community/in-other-news/jelly-basics-on-the-way-to-jelly-ninja-hood/ba-p/2281482