0

I don't see an answer to this in Stack Overflow, so I'll go ahead and ask:

In jQuery, if I have a boolean display2, what is the difference between:

display = display2;

and

display = !!display2;

I'm working with a code base that uses the second line in it. Seems to me that both ways of setting display would be the same. In the second one you are setting display to the opposite of the opposite of display2, which I would think would just be the original value of display2. What am I missing?

Lucky Brain
  • 1,241
  • 10
  • 13
David Tarvin
  • 537
  • 1
  • 5
  • 17

0 Answers0