jwhittle933 / adapter-app-api

REST API for Adapter App web app
MIT License
1 stars 0 forks source link

.hasHDMI, .hasVGA #30

Closed jwosborn closed 5 years ago

jwosborn commented 5 years ago

Because these values are being returned as strings, even the string "false" is being evaluated as truthy when forced into a boolean using !! .

jwhittle933 commented 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., !!).

jwhittle933 commented 5 years ago

This is something that JavaScript developers don't really deal with much, but type casting is very common in more OOP languages.

jwosborn commented 5 years ago

Typecast in a function within app.js now.