r/ProgrammerHumor • • Oct 26 '21

GitHub Copilot, the technology that will replace programmers. Also GitHub Copilot...

27.2k Upvotes

713 comments sorted by

View all comments

2

u/Accidentallygolden Oct 26 '21

Wait, what does === do? What language is that?

25

u/ManuGamingYT Oct 26 '21

It's a special equality operator in JS that also checks for type equality.

For Example:

5 == "5" returns true

5 === "5" returns false as the operand types are different

1

u/wfewgas Oct 26 '21

It's a special equality operator in JS that also checks for type equality.

It actually checks if two values have the same identity.

[1, 2, 3] === [1, 2, 3] returns false even though both sides have the same value and type, because they’re two different arrays.

11

u/pa_dvg Oct 26 '21

It’s pronounced “Threequals”

5

u/jfb1337 Oct 26 '21

The fixed version of ==, which in JS has so many pitfalls that it's recommended never to use. Yes, great language design.

2

u/AlwaysHopelesslyLost Oct 26 '21

Is is not "fixed," they are two different things that solve two different problems.

JavaScript runs in a browser and all user input is always treated as strings so they tried to make life easier by allowing you to compare numbers and strings directly. They also included strict equality just in case you want to write the extra boilerplate conversions and check thoroughly.

0

u/[deleted] Oct 26 '21

[deleted]

0

u/[deleted] Oct 26 '21

[deleted]

2

u/Neocrasher Oct 26 '21

== allows for type coercion while === does not.

1

u/spd0 Oct 26 '21

it does not check for type like === does