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.
На этой странице сайта вы можете посмотреть видео онлайн Write a variable in a text string using a dollar sign. - JavaScript Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Programming for Everybody 01 Январь 1970, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,494 раз и оно понравилось 10 зрителям. Приятного просмотра!