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.
In questa pagina del sito puoi guardare il video online Write a variable in a text string using a dollar sign. - JavaScript Tutorial della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Programming for Everybody 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,494 volte e gli è piaciuto 10 spettatori. Buona visione!