Why avoid increment (“++”) and decrement (“--”) operators in JavaScript?

前端 未结 16 1006
庸人自扰
庸人自扰 2020-11-22 06:23

One of the tips for jslint tool is:

++ and --
The ++ (increment) and -- (decrement) operators have been known to contribute

16条回答
  •  既然无缘
    2020-11-22 06:43

    In my view, "Explicit is always better than implicit." Because at some point, you may got confused with this increments statement y+ = x++ + ++y. A good programmer always makes his or her code more readable.

提交回复
热议问题