JavaScript Strings: Single or double quotes?
Three years ago there was a heated discussion about this in my team. And single quote won. Mainly because it was convenient to create HTML templates with in our Oracle JET framework. It also seemed to be the trend. Since Oracle wasn’t going to move to React/Angular/Vue anytime soon, I decided to get my feet wet with ES6/React a year ago with a couple of my personal projects and loved it.
Get Rajesh Naroth’s stories in your inbox
Join Medium for free to get updates from this writer.
With ES6, I use double quotes. Why? Because template literals uses `backquotes` which is kinda easy to confuse with single quotes. One of the main goals of clean code is to lower the cognitive load. Using double quotes help.
I also use Prettier, which seems to favor double quotes.






