1

I have been programming JavaScript for a little and am completely confused by the interchangeable usage of single and double quotation marks. I spent some time researching such matters and it appears there are now performance differences or memory impact, so what gives? Are they really just the same or is there something I am missing?

AFAIK the only benefit of double quotation marks is that you can reference single quotation marks without the pain of including the backslash escape character.

console.log('here is my sentence');
console.log("It's my sentence");

--- Update --- Forgot to say thank you for all of the responses and time taken to think about such questions and creating/fostering such a nice community.

ThePrimeagen
  • 4,462
  • 4
  • 31
  • 44
  • 2
    There’s no difference at all in JS. The only place where there is is JSON which requires double quotes. – Sami Kuhmonen Jul 21 '19 at 19:48
  • 2
    I always go double quotes because of the English language containing apostrophes on occasion. Also, adhering to the convention from other languages - difference between char and string lies there. No neccessary but convenient. – Konrad Viltersten Jul 21 '19 at 19:49

0 Answers0