Assuming an ES6 codebase, there are several ways to do interpolation in strings.
You could use string concatenation, involving
+ signs and a string for each piece of the template you’re working on. Using concatenation can quickly get out of hand when dealing with longer templates, not to mention reusability is hard unless you abstract away your template in a small function.
'Hello ' + name + '! It\'s a pleasure to greet you.'
You could use
... read the whole story at ponyfoo.com.
util.format in Node. Here we have placeholders such as
%s which describes how the value is to be formatted, but doesn’t say anything about the value that should be placed in that socket in the template. This method