EverythingMe / ffos-notes

Notes App for FirefoxOS
5 stars 21 forks source link

Use loose typing to simplify conditionals #16

Open nickdesaulniers opened 11 years ago

nickdesaulniers commented 11 years ago

Because types in JavaScript are loosely defined and be coerced at runtime this line can be rewritten:

if (oauthtoken && noteStoreUrl && shardUrl) {

if any of the above are undefined or the empty string, those values are falsy and evaluate to false. Please do not ever do variable != 'undefined'