DEV Community

[Comment from a deleted post]
Collapse
 
lukeocodes profile image
@lukeocodes 🕹👨‍💻

In JavaScript, double and single quotes are treated the same until it comes to escaping themselves. This choice was always down to what sort of string you're storing. Is it HTML? Probably save yourself a headache and use single quotes.

Template literals are great. But, they are parsed and should only be used when concatenation/interpolation/template functions(tags) are required (assuming that in the latest version of your browser/render they are faster than concatenated strings (which has been a back and forth battle for a while)).

I would worry about the performance of just replacing all strings with template literals without a need for them. There would always need to be an overhead for parsing the string.