#answer
Question number: 1 [answer]
Our goal is to conditionally show a shopping list. If we have at least 1 item in the array, we should render a ShoppingList element. Otherwise, we shouldn't render anything.
And yet, we wind up with a random 0 in the UI!
This happens because items.length evaluates to 0. And since 0 is a falsy value in JavaScript, the && operator short-circuits, and the entire expression resolves to 0.
&& - false ni izlab yuradi.
@Diyorbekk_dev
Post #740
95
Diyorbek.dev | 👨🏻💻 #Common_Beginner_Mistakes_with_React Question number: 1 Who can find the bug here? 😉 @Diyorbekk_dev

- 👍 1
- 🔥 1