Write a variable in a text string using a dollar sign. - JavaScript Tutorial

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: Programming for Everybody
1,494
10

Write a variable in a text string using a dollar sign.
-----------------------------------------------------------------------------------------------------
Write a variable in a text string using a dollar sign.

Hello, today we're going to show how to write variables in text strings with using a dollar sign.

We see, that we have two variables declared and initialized, thus variable firstName with the value John and variable lastName with the value Cage.

First we write the variable firstName into the text string by joining strings, where we must always add a plus sign between the variable and the text. The text must be placed in apostrophes.

We write the variable lastName into a text string using a dollar sign and curly braces, in which we place the variable lastName. In this case, we place the entire text string in the apostrophes.

Now let's try to display the page and see that joining text strings with plus signs and joining strings using the dollar sign works the same and both entries display the variable correctly.

Thank you for watching this video and if you like, subscribe to this channel and put like.


Auf dieser Seite können Sie das Online-Video Write a variable in a text string using a dollar sign. - JavaScript Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Programming for Everybody 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,494 Mal angesehen und es wurde von 10 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!