DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Cover image for Oh JavaScript...
Harsh Shandilya
Harsh Shandilya

Posted on

Oh JavaScript...

Top comments (1)

Collapse
 
sainig profile image
Gaurav Saini

I got another one, it goes like this

0 == '0'  // gives true, okay, I'm there
0 == []   // also gives true, hmm, I see where you're going with this

// so according to basic maths,
// if a equals b, and a equals c, then b must be equal to c
// okay, let's try this

'0' == [] // gives false

// aight Imma head out

Its funny, how I actually faced this problem in an real production project. Last day I ever used ==

We are hiring! Do you want to be our Senior Platform Engineer? Are you capable of chipping in across sysadmin, ops, and site reliability work, while supporting the open source stack that runs DEV and other communities?

This role might just be for you!

Apply now