r/ProgrammerHumor • • Aug 01 '22

>>>print(“Hello, World!”)

Post image
60.8k Upvotes

5.7k comments sorted by

View all comments

1.8k

u/[deleted] Aug 01 '22

0 == "0"

86

u/Draconian-Overlord Aug 01 '22

Zero is a string measurement of your mom's thong.

3

u/[deleted] Aug 01 '22

Don’t know what this means, but it got me laughing.

→ More replies (3)

17

u/cucumberks Aug 01 '22

True

11

u/no-one-here123 Aug 01 '22

see? Javascript does make sense!

→ More replies (2)

19

u/itzNukeey Aug 01 '22

knowing javascript it will return '1'

7

u/redcowerranger Aug 01 '22

But 0 === “0” would return ‘0’ iirc

→ More replies (2)
→ More replies (1)

4

u/Deon2137 Aug 01 '22

the correct anwser is javascript hell

4

u/Vycid Aug 01 '22 edited Aug 01 '22

> 0 == "0"

False

Also acceptable is a compiler error due to type mismatch.

Godbolt GCC says

> printf(0 == "0" ? "True" : "False");

False

There's simple, then there's wrong.

2

u/the_clash_is_back Aug 01 '22

0 is a variable which is true if it is the character 0.

2

u/ChuckFina74 Aug 02 '22

You’re sick

→ More replies (9)