One Code Instead of The Other


#1

<Hello!>

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,
Ghina


#2

${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.


#3

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