Tell us what’s happening:
I’m stuck on finding a way to tell the “truthiness” of isCartShowing.
I already ran into That Post (perfect to rethink about my code, and how to think the ternary operator)
I know I’m being confused by the fact that I needed to invert the value of isCartShowing before. Furthermore, I tried to check is isCartShowing had just any values, but it doesn’t work…
Your code so far
cartBtn.addEventListener("click", () => {
isCartShowing = !isCartShowing;
isCartShowing = showHideCartSpan
? showHideCartSpan.textContent="Hide"
: showHideCartSpan.textContent="Show";
});
Thanks for any advice in advance
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Learn Basic OOP by Building a Shopping Cart - Step 39