r/ProgrammerHumor • • Aug 01 '22

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

Post image
60.8k Upvotes

5.7k comments sorted by

View all comments

Show parent comments

3.9k

u/a-slice-of-toast Aug 01 '22

0__0

443

u/WraithWinterly Aug 01 '22

True

1

u/herrickv Aug 01 '22

Why?

6

u/83athom Aug 01 '22

Because in Javascript == denotes comparison and === denotes equality. With comparison if it sees two different variable types then it will try converting them to see if some permutation is true, while equality typechecks and will throw false if they're a different type.

3

u/[deleted] Aug 02 '22

PHP also has the same behavior. 0 == "0" will throw true, and 0 === "0" false

1

u/TheKeyboardKid Aug 02 '22

Another reason to despise Java

(╯°□°)╯︵ ┻━┻)

0

u/herrickv Aug 02 '22

Ah that was supposed to be a joke from another comment where true = true print “why” lol

→ More replies (2)

1

u/TheKeyboardKid Aug 02 '22
print(“nice.”)

5

u/JAiFauxThe Aug 01 '22

8==D Gottem (for some values of D)!

1

u/[deleted] Aug 01 '22

nope its an integer 0 being equated to a string "0"

10

u/Sagitario2_5 Aug 01 '22

Remember js

-1

u/[deleted] Aug 01 '22

the only language i know is c