-1

I have googled on this issue. There seems to be no difference between using "" or '' to encapsulate a string. It is hard to decide. Is it correct to say it is a better idea to use "" because it is compulsory in json to use ""?

guagay_wk
  • 26,337
  • 54
  • 186
  • 295
  • 7
    [Difference between single quotes and double quotes](http://stackoverflow.com/questions/3149192/difference-between-single-quotes-and-double-quotes-in-javascript) or [When to use double or single quotes in JavaScript](http://stackoverflow.com/questions/242813/when-to-use-double-or-single-quotes-in-javascript) – Tushar Nov 22 '15 at 08:55

1 Answers1

0

As you might know javascript is a loosely typed language, which means there is no real difference between the two cases, some programmers who has a c++, c#, java background experience still using single quotes for one letter and double quotes for strings, actually it is back to you which one you prefer to use.

  • 2
    What does loose/weak typing have to do with the quotes you use to encapsulate a string? – robertklep Nov 22 '15 at 09:25
  • The parser is not strict to make developer you one type meaning you have a choice where is some compiled languages you don't have that choice. – simon-p-r Nov 22 '15 at 11:16