Template strings

Template strings are strings that are enclosed within backticks (that is, ` ).

Note: the backtick character is typically found on the same key on your keyboard as the tilde (that is ~), and is immediately to the left of the number 1 key.

JavaScript always gave us the ability to create strings using double quotes as well as by using single quotes, so what was the motivation for the third type of string creation character? Well, as it turns out, given the proliferation of frontend frameworks, there was a common need to do three things:

  • String interpolation
  • Multiline strings
  • Tagged templates
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.77.195