Templating with Handlebars


#1

Hello,

I am having a hard time understanding Handlebars. I am following the instructions from the exercise “Templating with Handlebars”. But item 32 and 33 asks to assign 2 different values for the same variable ‘compiledHTML’. Isn’t this strange?

I am attaching an image with my code and the instructions.

If anyone can help me understand this, I will appreciate a lot. Thanks,

https://www.codecademy.com/paths/web-development/tracks/build-interactive-websites/modules/templating-with-handlebars/projects/musicon


#2


#3

Does not look like the case. One is an assignment to the variable, the other is an assignment of the variable.

compiledHTML contains an HTML string, which is then inserted into the DOM on the element with id ‘information’.


#4

Thank you very much. The " assignment of the variable" is a new concept to me. It’s difficult to understand.


#5

Consider,

a = 42;    // assign number to variable
b = a;     // assignment of variable to another variable

Assignments are always right to left. The value or variable on the right is being assigned to the variable on the left of the equals sign.