Using && operator :
we also can use the trenary operator but it will increase the complexity of the code so you can try the && operator
if one of the statements on both side of the && is true it will execute the second one
if one of the statements on both side of the && is false it will execute nothing
Using if else condition :
But you can say that if the templates are too big then it will dificult to find the error then we can save the template inside a variable and can use it in the condition
we can use that like given below