paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

Question: Template literals supported? #452

Closed GitToTheHub closed 5 years ago

GitToTheHub commented 5 years ago

I only wanted to ask, if template literals are supported, like this:

var myVar = "test";
console.log(`This is a ${myVar}`);

Thank for responding :)

zloirock commented 5 years ago

It can't be polyfilled, it's a work for transpiler. For modern syntax support, use Babel.

GitToTheHub commented 5 years ago

Ok, thank you for your reply! Can i maybe use this syntax style:

var myString = "This is a very long string which needs \
to wrap across multiple lines because \
otherwise my code is unreadable.";
ljharb commented 5 years ago

That’s alwsys been part of JS, but yes.

In general, syntax must be transpiled; only API can be polyfilled.

GitToTheHub commented 5 years ago

Ok, thank you really much for your reply :) Have a nice day :)