In this module we learned a lot about conditionally outputting content and outputting lists
and I just want to briefly summarize this before I send you off to the assignment
and let you practice that because it's so crucial to get it right and to understand it.
We did learn two important things, that we should output content conditionally by using javascript and
the same for lists.
Everything is javascript, key takeaway.
You can then either do it with ternary expressions as you learned but a better approach is to simply create
variables which you output in your jsx you return in the end and which you adjust with if statements
if you want to render something conditionally.
And if you want to return or render a list, you use the map operator,
a default javascript method you can use on arrays to map your javascript array of objects or strings
or whatever is inside of it into an array of jsx elements and react will then pull out these elements
and render to the screen for you.
You also learned that map gives you not only the element for which it's currently executing this function
but also access to the index if you need that, for example, to remove an element that you should add this key
to let react efficiently update everything and that you have a couple of tools, as you can see here
for updating the name to really execute code on the element of a list on which something really happens.
You learn a lot of useful things here but the best way as always is to just practice it.
So let's move on to an assignment so that you could put all these things you just learned into practice
on your own.