Jane Volin4,193 Points
What is the difference between using single or double quotes around a statement?
It seams like they serve the same purpose. I recently completed the code academy java script course and they use single quotes throughout their script. Just curious about what is the best practice and why?
Nick Yoho6,957 Points
It depends how you use it, but they do the same thing. A double quote surrounding a string that has a word containing an apostrophe in it will work normally. If you have single quotes around the same string you will get an error unless you add a \ within the word with the apostrophe (that\'s) to escape it.
Jason AndersTreehouse Moderator 144,974 Points
Like Nick has said, there is no difference. It really is personal preference, just remain consistent in your code.
Just an additional note... with some languages (i.e. PHP), double quotation marks act differently than single quotation marks, and using one instead of the other could break you code. But for the most part (and most languages) it really is just a preference.