HTML5, ES6 template string polyfill

与世无争的帅哥 提交于 2019-12-01 16:03:26

There are 3 main ES6 polyfills that can give you template string support but none of them have full support as you can see at kangax's ECMAScript support table.

  • Traceur - This is Google's ECMAScript polyfill that support some ECMAScript 6 and ECMAScript next features, it have 4/5 support for template strings, there is no toString conversion.

  • Babel - Another ECMAScript polyfill, have more support in general but also have only 4/5 support for template strings, also no toString conversion.

  • es6-shim - I'm not sure if it's even developed anymore, but it doesn't have template strings anyway.

But you might want to think twice before using template string, it just a syntactic sugar for string with + to add variables and \ to have multi lines.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!