MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/21ezh3/javascript_equality_table/cgczp4o/?context=3
r/programming • u/vz0 • Mar 26 '14
331 comments sorted by
View all comments
17
While not JavaScript, we must not forget about Python's False Midnight.
tl;dr:
if datetime.time(0,0): print "t" else: print "f"
Prints "f".
if datetime.time(1,0): print "t" else: print "f"
Prints "t".
12 u/[deleted] Mar 26 '14 Why do so many dynamic languages have this obsession with using non-boolean values in conditionals? 1 u/[deleted] Mar 27 '14 edited Mar 27 '14 [removed] — view removed comment 3 u/NYKevin Mar 27 '14 So, in C, what happens if you try to shove a struct foo into an if? I don't mean a struct foo*, I mean the actual data itself. → More replies (1)
12
Why do so many dynamic languages have this obsession with using non-boolean values in conditionals?
1 u/[deleted] Mar 27 '14 edited Mar 27 '14 [removed] — view removed comment 3 u/NYKevin Mar 27 '14 So, in C, what happens if you try to shove a struct foo into an if? I don't mean a struct foo*, I mean the actual data itself. → More replies (1)
1
[removed] — view removed comment
3 u/NYKevin Mar 27 '14 So, in C, what happens if you try to shove a struct foo into an if? I don't mean a struct foo*, I mean the actual data itself. → More replies (1)
3
So, in C, what happens if you try to shove a struct foo into an if? I don't mean a struct foo*, I mean the actual data itself.
struct foo
if
struct foo*
→ More replies (1)
17
u/MisterSnuggles Mar 26 '14
While not JavaScript, we must not forget about Python's False Midnight.
tl;dr:
Prints "f".
Prints "t".