this post was submitted on 07 Sep 2023
29 points (69.9% liked)
Programmer Humor
32571 readers
450 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It looks like it's just assigning the scope variable
m
totrue
(alsofalse
in them=!1
case.It's minified code and
m=!0
is fewer characters thanm=true
.Well I hate that. Is there a reason
m=1
wouldn't be the same thing asm=!0
?Types are dynamic so I think the ! operator converts int to bool in JS
1 is truthy, but not the exact same thing as true, and the distinction can be important.
1 != true, 1 is an int, true is a boolean