DEV Community

Discussion on: Minimize the below code

Collapse
 
macsikora profile image
Pragmatic Maciej • Edited

I don't think there exists Id which is 0 but your point is correct and the proper check would !== null. That's the whole thing should be done here.

Also I only mentioned TS to describe what type has this variable. You don't need to use explicit types, you still have types.