Converting strings to template strings

Andrea Giammarchi andrea.giammarchi at
Mon Mar 23 20:52:56 UTC 2015

Even a function wouldn't scale that well for i18n purpose, 'cause you
should write either a function per language or each language switch
statement per function.

I see current ES6 string templates good for debug purpose only, and not
much else ... maybe English centric developers tools so few, definitively
good use cases, but nothing that useful or powerful for the known Web.


var template = ``Hello ${name} !``;

template({name: 'there'}); // Hello there !


But I know, double back-tick might look too like double rainbow: "OMG what
does it mean" ??!


On Mon, Mar 23, 2015 at 9:29 PM, Brendan Eich <brendan at> wrote:

> Jason Orendorff wrote:
>> But from the few data points I have, approximately 100% of web
>> developers, when they first hear "template strings are in ES6", think
>> that means something like Mustache in the standard library. Some
>> initially try to use the feature that way and get frustrated. I expect
>> widespread confusion on this point.
> This.
> A function wrapped around a template string, where the function's
> parameters occur in embedded expressions, goes a long way. But you have to
> write the function, after teaching people the basics and apologizing for
> misleading them with the t-word.
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list