Short-Circuting, shortening your code
When I’m writing, I like to shorten things as much as I can. One thing I use are short-circuts. A short circut relies on how && and || evaluate. A && operation evaluates the left side, and only evaluates the right side if the left side returns “truthy”(anything but false,0,”,null,undefined, and NaN). || is the oppisite, if the left is false, the right is evaluated. You can also use || to establish defaults in a function. examples::
