Skip to content Skip to sidebar Skip to footer

Using Es6 Template Literals In Nodejs V4.4.2

I need to use ES6 Template Literals in Node v4.4.2. After setting jsconfig.json I am not able to create my string properly. Any idea what am I missing here? var name = 'Juan',

Solution 1:

2 Things:

  1. ` instead of '
  2. No spaces after $

Something like this:

var name = "Juan",
    job = "flying penguin";
var sentence = `Hello ${name},the ${job}!`;
console.log(sentence);

Post a Comment for "Using Es6 Template Literals In Nodejs V4.4.2"