r/javascript • u/bornforcode • Apr 01 '18
Google publishes a JavaScript style guide. Here are some key lessons.
https://medium.freecodecamp.org/google-publishes-a-javascript-style-guide-here-are-some-key-lessons-1810b8ad050b
714
Upvotes
9
u/grinde Apr 01 '18 edited Apr 01 '18
A template literal with no replacements is parsed identically to a string using
'or", so there should be no performance hit. Since it's a much less used character than the other two, that also means less escaping.EDIT: Since I've been digging around in v8 lately anyway, here is the exact line that this happens. If there's only one cooked string, we're not even creating a template literal as far as the engine is concerned.