One Code Instead of The Other



I would like to ask a question.

Why do I have to learn how to code this console.log(My name is ${myName}. My favorite city is ${myCity}.); and use it, when I could simply write this console.log(‘My name is Guni. My favorite city is Damascus.’);

Thank you,


${myName} and ${myCity} are variables, you can assign any value to these variables and these values will be reflected on your console.log() without having to rewrite the console.log() line of code.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.