Re:Show HN: Learn and practice modern JavaScript
by kiriakasis on Saturday January 05, 2019 @07:45PM
(#18835497)
The fact that JSON.stringify uses double quotes is slightly in favour of using single quotes in handwritten code
Re:Show HN: Learn and practice modern JavaScript
by marcosdumay on Thursday January 03, 2019 @02:09PM
(#18818151)
It matches SQL, that is the one language one is most likely to write at the same time as any other language.
Modern Javascript has template literals using backticks so arguably the new rule should be used double quote everywhere except use a template literals for HTML or whenever doing string manipulation.
The number one thing I hate about using single quotes it is matches almost no other languages so it ruins muscle memory if switching between languages.
JS itself prefers double quotes. See JSON.stringify or log anything to the console that gets auto quoted, always uses double quotes