The downto operator - an ES7 proposal


I had posted about this two years back when it was scheduled for ES6 but this feature did not get accepted then. But now, it’s been finally accepted by the committee in the ES7 proposal!
(ES6 and ES7 are the next version’s of JavaScript; read more)

That’s awesome! What does it do?

It’s a very simple operator, and best explained by an example:

var i = 10;

while(i --> 0)     // '-->' is the downto operator

As you can see, this operator is used with loops. It basically says that loop till i goes down to a limit, which in this case is the number 0.

This operator makes our code very easy to read and understand, and I am glad it’s coming in ES7.

What are your thoughts about it? Do you like it? Discuss below! :slight_smile:


Wow! That’s awesome. Can we use it in our code already??? :hushed:


It works!

#4 usually implements the proposal’s quickly, like this one, so that we coders can experiment with them :tada: :tada: :smiley:


I like it!  


I think Codecademy have updated so that it works here too :smiley: :confetti_ball:


Yes! Thank you Codecademy team!