Does activating the pump in a vacuum chamber produce movement of the air inside? Connect and share knowledge within a single location that is structured and easy to search. String literal vs String object I'm almost ", " years old. For example, without template literals, if you wanted to return a certain value based on a particular condition, you could do something like the following: With a template literal but without nesting, you could do this: With nesting of template literals, you can do this: A more advanced form of template literals are tagged templates. The question specifically requested "is this supported in any form in javascript" and was referring to "denot[ing] a string as to not need escaping". Find centralized, trusted content and collaborate around the technologies you use most. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. String literals (denoted by double or single quotes) and strings returned from String calls in a non-constructor context (that is, called without using the new keyword) are primitive strings. Frequently asked questions about MDN Plus. It can be either positive or negative if no sign precedes it is assumed to be positive. a little globber. In C#, Ruby, and many other languages you can denote a string as to not need escaping. // Logs "string text line 1 \n string text line 2" , // including the two characters '\' and 'n', // Some formatters will format this literal's content as HTML, Normally, JavaScript strings are primitive values, created from literals: let x = "John"; But strings can also be defined as objects with the keyword new: let y = new String ("John"); Example. Template Literals is not supported in Internet Explorer. How do I make the first letter of a string uppercase in JavaScript? Template literals or Template Strings are delimited with backtick(`) characters, template literals allows you to perform some actions mostly create a string by doing substitution of placeholders which can be little complicated if you will use the normal way. With template literals, you can avoid the concatenation operator and improve the readability of your code by using placeholders of the form ${expression} to perform substitutions for embedded expressions: Note that there's a mild difference between the two syntaxes.