Ternary Operator | Table O Contents
- Ternary Operator | Table O Contents
Flammarion Logo Badge in the page header above is an
.svg image file set to the dimensions of
auto height, and
zoom. Go ahead and test the
zoom-out feature by hovering over the badge to engage the expansion of the image.
Hint. Store in a constant variable …
const cartItemCount = isAuthenticatedUser ? 1 : 0;
In Action Test
const isAuthenticatedUser = true; // const isAuthenticatedUser = false; const cartItemCount = isAuthenticatedUser ? 1 : 0; console.log(cartItemCount);
Steps of the Algorithm
// Store in a constant variable named `cartItemCount` ... // Is our subject an `authenticated user`? // If so by placing a Boolean function upon the element ... // Returns `true` // Statement resolves to `1` // Or, // After initially placing a Boolean function upon the element ... // Returns `false` // Statement resolves to `0` // Stop
More to come …
Note. The above synopsis was derived from a video lecture written, produced and performed by …
Reed Barger: .
For additional reference on the topic of
Ternary Operators see the
Mozilla Developer Network: 
Ternary Operators see
Mozilla Developer Network
Please support the co-workers who aggregate the Source Links for our projects.
Like what you see in this project? If so, then support the authors and
machine-elves who aggregate the source links and pages for our projects via Patreon.