Difference Between Single and Double Quotes in Javascript

In PHP specifically, there are several differences in the way the information between single and double quotes are processed. Since a lot of PHP developers delve into the world of Javascript as a natural extension, we can get caught up in the idiosyncrasies of PHP unnecessarily. So, what is the difference when dealing with Javascript? There is no difference. If I want to display double quotes, I would probably use single quotes to display them, rather than escaping the double quotes from within double quotes. Same thing with displaying single quotes, I would probably use double quotes to display them rather than escaping them from a string within single quotes.

Posted by Will on November 13, 2012

Leave a Reply

Your email address will not be published. Required fields are marked *