ES6 Template Strings

node v4.9.1
version: 1.0.0
endpointsharetweet
In ES6 you can use template strings to more easily construct strings:
var person = { name: "Tom", age: 20 }; // Before: var string = person.name + " is " + person.name + " years old"; // Now: var string = `${person.name} is ${person.age} years old`;
Template strings also allow you to write multi-line strings:
var string = `This is<br/> a multi-line string<br/> without having to use<br/> any tricks. Pretty userful<br/> for HTML`
For much more advanced template strings, check out: https://hacks.mozilla.org/2015/05/es6-in-depth-template-strings-2/
Loading…

14 comments

  • posted a year ago by jnee505
    http://instagram.com/f008
  • posted a year ago by varobalabanoglu1
    Varolbalabanoglu@gmail.com
  • posted a year ago by falconxunit
    How about chrome.
  • posted a year ago by ralitsa
    Hellow i nid you help me
  • posted a year ago by btmh2003
    Está bonito lindo día para que sientas mal
  • posted 7 months ago by 5a590a66b67f620012817bc8
    Good
  • posted 7 months ago by florin
    Good
  • posted 6 months ago by 5a8f236f78679e0012cbc9a9
    can you help me to
  • posted 5 months ago by rake
    Good coordinator
  • posted 5 months ago by kingvader
    Can you help me
  • posted 5 months ago by mohdakram
    Can you help me plzz
  • posted 5 months ago by sherrielee
    Hello i need someone to help me please
  • posted 2 months ago by retweett511
    Twitter followers follow tweets and Facebook META data transfer t retweett511
  • posted 5 days ago by tamu18115
    automobileservices.org

sign in to comment