Why to use backtick in JS?

I have seen this is the ES6 feature of JS but why to use backtick if I get the same output through single or double quotes in strings?

1 Like

You can read about it here:

1 Like

You can use variables without needing to start and stop string concatenation `text${var}text` instead of 'text'+var+'text'. You can mix single and double quotes, which is useful for HTML.


Just be aware that the backtick isn’t supported in IE 11, Safari 9, or Opera 28.

The date-relative view of supported browsers at can I use is a useful way to view relative compatibility across browsers.

Which is why you use babel for transpiling, so you can have that development comfort in the editor, but a working script in your browser.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.