Positive Number to Negative Number in JavaScript?

后端 未结 13 1638
误落风尘
误落风尘 2020-12-13 05:16

Basically, the reverse of abs. If I have:

if ($this.find(\'.pdxslide-activeSlide\').index() < slideNum - 1) {
  slideNum = -slideNum
}
console.log(slideNu         


        
相关标签:
13条回答
  • 2020-12-13 06:09

    Use 0 - x

    x being the number you want to invert

    0 讨论(0)
提交回复
热议问题