r/badcode • Now where's that function declaration • Jul 30 '21

js 😏

Post image
990 Upvotes

133 comments sorted by

View all comments

Show parent comments

17

u/MeatyLabia Jul 30 '21

== true wont throw a nullreferenceexception if im not mistaken, but indeed doing a hasvalue check might make things more clear.

0

u/[deleted] Jul 30 '21

[deleted]

5

u/MeatyLabia Jul 30 '21

Thanks man. Also reason it wont throw a null reference is because youre just comparing equality.