14
while (max --> min)
{
    console.log(n);
}

I know that --> decreases the value, but where is --> documented in the official documentation?

Braiam
  • 1
  • 11
  • 50
  • 74
diao Yerik
  • 199
  • 1
  • 5

1 Answers1

26

It is the post decrement operator -- followed by the greater than operator >. Just the spacing is weird.

while (max-- > min)

So, while max decremented is larger than min

zerkms
  • 240,587
  • 65
  • 429
  • 525
deceze
  • 491,798
  • 79
  • 706
  • 853
  • 3
    Just a nitpick, wouldn't "`max` decremented is larger than `min`" be better suited for something like `--max > min`? – Aioros Aug 26 '16 at 11:55
  • 1
    @Aioros *"`max`'s value which is decremented afterwards is larger than `min`"* seemed a bit unwieldy. I expect everyone knows how `--` works… :) – deceze Aug 26 '16 at 11:56
  • would this work in for loop like `for( let i = 0; i++ < n; )` – Rahul Yadav Apr 13 '21 at 23:10