I apologize if this a stupid question, but I cannot find the answer anywhere.
How does the following code work? (I realize that it loops over the elements of els
)
var i = els.length;
while (i --> 0) {
var el = els[i];
// ...do stuff...
}
I have no idea what -->
means. There is no documentation for it. Can someone enlighten me?
-->
as a kind of pseudo "count down" operator. The whole statement to be read as "i goes to zero"... – Athanorwhile(i--)
is enough. – Staurolitei
starts off>= 0
, the loop could continue. – Randolf