Posted By

heathbo on 07/13/18


Tagged

javascript template literals


Versions (?)

Javascript Strings with Template Literals


 / Published in: JavaScript
 

How to create and use strings with template literals.

  1. var a = 5;
  2. var b = 10;
  3. console.log(`Fifteen is ${a + b} and
  4. not ${2 * a + b}.`);
  5.  
  6. // "Fifteen is 15 and
  7. // not 20."

Report this snippet  

You need to login to post a comment.