Closed jwosborn closed 5 years ago
SQL databases don't store boolean
types yet. So true/false
has to be a string. When you get back the object, you have to access that property specifically and cast it to boolean (i.e., !!
).
This is something that JavaScript developers don't really deal with much, but type casting
is very common in more OOP languages.
Typecast in a function within app.js now.
Because these values are being returned as strings, even the string "false" is being evaluated as truthy when forced into a boolean using !! .