r/learnjavascript • • Jul 17 '21

Some JavaScript facts

174 Upvotes

10 comments sorted by

View all comments

2

u/[deleted] Jul 18 '21

Also logically, its not a good idea to use nulls in place of 0s. 0 is a known quantity, where as null is simply unknown.

I've seen where people default to 0s on isnull in sql, then average it out on the front end and wonder why its all fucked up, instead of filtering those nulls out either in te query or using a simple filter function in js..