Short Circuiting in JavaScript
Introduction
Consider the following code snippet:
// if-else statement
if (isUserLoggedIn) {
return privateData;
}
else {
return false;
}
The above code can be written in a more concise way like this:
// Short Circuiting
isUserLoggedIn && pr...
vishnuvnair.hashnode.dev5 min read