es6 new Grammar `` $ {}

This is a new string method in es6

Anti single quotes may be blended completion string concatenation

1, the backward apostrophe how to play out?
Adjust the input method in English input method, click the number keys on the keyboard to the left of the 1 key.

2, Usage
step1: definition requires splicing into the string variable
step2: the string variable} by $ {wrap, and then written to local needs splicing

3, the sample code:

A = the let 'Karry Wang' ; 

the let STR = `$ {A} the I Love, Because of He IS handsome.`;
 // NOTE: This line is caused to return to a single number of 

alert (str);

Must use single quotation marks ah! Do not write a single quote! !

Guess you like

Origin www.cnblogs.com/Alitar/p/11588934.html