i— and i = i-1 not evaluating the same

前端 未结 4 632
渐次进展
渐次进展 2021-01-26 18:32

I thought that i-- is a shorthand for i = i - 1, but I discovered that both evaluate different:

         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-26 19:06

    You should use --ias the pre-decrement operator.

    See the docs here

提交回复
热议问题