Most JavaScript (or TypeScript) developers know that the language allows expressing string literals using either double quotes (“) or single quotes (‘). Given that both ways of expressing strings are semantically equivalent, this leads to the question of which one is the “right” way.

Generally, when it comes to coding style, it is advisable to conform to the convention of the particular language you are dealing with (for example, using camelCase for methods in JavaScript, but PascalCase in C#).

Unfortunately, it appears that there is no official convention for string quotes when it comes to JavaScript. So, the next best…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store