![]() a -> This is another sample with a 'quote' in it // b -> This is yet another sample with a "double quote" in it Let b = "This is yet another sample with a \"double quote\" in it" Let a = 'This is another sample with a \'quote\' in it' Let z = 'This is a sample string with a "double quote" in it' Let y = "This is a sample string with a 'quote' in it" Consider the following example: let x = 'This is a sample string' The Old Way of Handling String Templatesīefore ES6, single quotes or double quotes were used to declare a string. It allows us to embed expressions (expression interpolation) inside a string declaration, handle multiline strings and create "tagged template literals" which is a more advanced form of template literals. Template Literals were introduced with JavaScript ES2015 (ES6) to handle strings in an easier and more readable way. Other than that, we are also going to cover what Tagged Template Literals are and how we can use them with regular Template Literals. ![]() They were also called Template Strings prior to the ES2015 specification. ![]() In this article, we are going to talk about JavaScript Template Literals.
0 Comments
Leave a Reply. |