Template literals working on other browser except IE

后端 未结 2 442
北恋
北恋 2021-01-16 22:57

I am working on javascript and using \"Template literals\", which is working on the Chrome and Firefox, but it is not working on the Internet Explorer(IE).

2条回答
  •  温柔的废话
    2021-01-16 23:12

    Another option is if you already are using lodash to switch to its _.template function which allows a lot more than just templating literal functionality and has wide browser support.

    var compiled = _.template('hello ${ user }!');
    console.log(compiled({ 'user': 'pebbles' }));   // => 'hello pebbles!'

提交回复
热议问题