FAQ: Learn Handlebars - Review

This community-built FAQ covers the “Review” exercise from the lesson “Learn Handlebars”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Building Interactive JavaScript Websites

FAQs on the exercise Review

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

I don’t understand why the link on line 26 of the HTML index page is included. Can anyone shed light on this for me please?

I’m trying to get my head round what exactly you can do with Handlebars that you can’t do with template literals and variables. Can anyone give a real world example?

2 Likes

Hi Laura, I was wondering the exact same thing which is how I found the post. Then later on in the follow up project I understood what was going on.

The element on line 26 is the method we use to link the HTML file with our own JavaScript file, like we have done in earlier exercises. In this case it is named main.js and that is the file you are writing your JS code in.

The additional script elements in the head are only to create a template and to link the Handlebars library which is in a separate JavaScript file that you are not editing and do not have visible on your screen. If you click on the folder icon to the left of the index.html tab you will see it is stored in there.

1 Like

I agree. Why would I use handlebars if else to change a

when I can just use javascript to update p.innerHTML with a if statement…