In other words, inside an IIFE, we can use any type of conditional logic. I feel that this code follows a pattern that is reasonably repeatable, readable, and less error-prone than the other techniques. With template strings its pretty easy tag function. Another method for conditionally rendering elements inline is to use the JavaScript conditional operator condition ? This isn't good or bad; it just adds to your considerations when creating large template strings. Follow Up: struct sockaddr storage initialization by network format-string. Its not really componentized though. Like with most things in programming, some things are better suited than others depending on the problem you're trying to solve. This is an important distinction to understand. The first one uses an ifelse block to show/hide the SubHeader component: The second one uses the short circuit operator &&to do the same: Open the Inspector and click on the button a few times. Like books, movies, and still trying many things. The area and perimeter just are correct. Consider these two components: This includes the JavaScript logical && operator. To learn more, see our tips on writing great answers. instantsearch. Is it possible to apply CSS to half of a character? I argue that it is not. Just about any code or process to build a web app that has existed since the inception of the web will still work today. No for-loops, just a list of objects converted to a list of HTML elements. Please note that for the drop down menu, only the name of the kid is rendered, and NOT the img-url. When we load a new blog post, we can just scrap the DOM and rebuild it. Then reference the files in the HTML page. I mean, come on, look at how quick this code solves the problem! This HTML is slightly more complicated than what we saw with the