>
>
> I'd like to be able to do something like:
>
> function safe_html(template_string) {
> // note: mapping dictionary d constructed explicitly, not based
> on what's in scope where template literal appeared
> var d = { x: 'strong', u: 'world'};
> return template_expand(template_string, d);
> }
>
>
Does it help to think in terms of arrow functions? We're assuming that the
caller knows about the template and the callee knows about the data. If
so, then we can do something like this instead:
let formatted = getData(data => `<${data.x}>hello, ${data.u}</${x}>`);
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss