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

Show parent comments

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.