Reputation: 15372
I've recently seen some script in which a property is being set to true using the following.
someProp: !0
I understand that this will evaluate to true, but don't understand why someone would set a property in this way. Is there a reason?
Upvotes: 1
Views: 63
Reputation: 172408
I dont think there is any specific reason rather a matter of programming and writting code. Some people like things going crazy and I think this is one of them.
!1 means false and !0 - means true
Upvotes: 3