Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Basic and Multiple Line Strings

Template literals have no support in IE. So if/when should they be used?

I've noticed that template literals, while awesome, have NO support in IE. That's still a large market share to ignore. For this reason, when, if ever, would one want to use template literals at this time as a web dev?

Thanks, guys!

2 Answers

Steven Parker
Steven Parker
229,708 Points

You might want to delay adopting any new technology until it is well supported.

If you're preparing content for the world market, you'll have to be among the last to adopt the newer technologies. Just keep an eye on resources like Can I Use? for when things change.

On the other hand, developers who's consumer base are in a corporate intranet, and where all the browsers can handle the current technology, are probably using these technologies already.

Thanks, Steven!

Rich Donnellan
MOD
Rich Donnellan
Treehouse Moderator 27,671 Points

It's worth noting that using a tool such as Babel can compile your "future" code to supported ES5 syntax. You can see an example here: https://babeljs.io/docs/plugins/transform-es2015-template-literals/

Nice! Thank you for pointing that out.

Abraham Juliot
Abraham Juliot
47,353 Points

Just be aware that in template literals, babel as well as typescript will sometimes compile every tab space to tab characters, which makes the compiled string unreadable. Personally, I prefer using an array and the join method for string templates. It looks fairly nice and the output remains readable.