(For Badass JavaScript Development)
NOTICE: I have written only 2 of the 12 tips so far, but I plan to post all 12 Powerful Tips eventually.
I provide you with 12 simple, yet powerful, JavaScript tips and detailed explanation of each. These are techniques that all JavaScript programmers can use now; you needn’t be an advanced JavaScript developer to benefit from these tips. After you read all of the detailed explanations of how each technique works and when to use it, you will have become a more enlightened JavaScript developer, if you aren’t already one.
Indeed, notable JavaScript masters and enlightened JavaScript developers have been using many of these techniques to write powerful, efficient JavaScript. And in a bit, you will, too.
[sc:mongodb-book]-
Powerful JavaScript Idiomatic Expressions With && and ||
You see these idiomatic expressions in JavaScript frameworks and libraries. Let’s start off with a couple of basic examples:
Example 1: Basic “short circuting” with || (Logical OR)
To set default values, instead of this: