What does while (i --> 0) mean?

Viewed 13802

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?

5 Answers
while (i--> 0) 
{
    // ...do stuff
}

is same as

while (i>0) 
{
     i--;    
    // ...do stuff
}

IMHO we should write simple code rather than clever code because it's not understandable by everyone.

Related