gilbert189 β€” 1/20/2023, 11:04:59 PM

In JavaScript, [] == 0 is true.

In JavaScript, [0] == 0 is also true.

You might assume [] == [0] is true from this.

But no. JavaScript says it's false.

β™₯ 3 ↩ 1 πŸ’¬ 3 comments

comments

pkmnq:

It works with strings too, look:

In JavaScript, β€œβ€œ == 0 is true.

In JavaScript, β€œ0” == 0 is also true.

You might assume β€œβ€œ == β€œ0” is true from this.

But no. JavaScript says it’s false.

1/21/2023, 2:17:55 AM
oren:

That's from my meme right

1/20/2023, 11:20:47 PM
gilbert189:

it’s a repost from the TBGs

but yeah I made it from yours

1/20/2023, 11:33:41 PM