Template Literals

Also known as String Literals or Template Strings
This uses the Backtick ` to enclose the string characters


var myString1 = "one" 
var myString2 = "two"
var myString3 = `text $(myString1) more text $(myString2)`

Multi-Line

This preserves the line breaks

var myString3 = `text $(myString1) 
   more text
   $(myString2)`

var myString1 = 100 
var myString4 = `some text $("$" + myString1)`


© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext