What is the convention for quotes - double or single?
It has little meaning, but would be nice for consistency.
jQuery suggests double.
Single quotes indeed.
What is the convention for quotes - double or single?
It has little meaning, but would be nice for consistency.
jQuery suggests double.
Single quotes indeed.
For JavaScript files quotation is purely stylistic as string literals in JavaScript are specified as either wrapped in double quotes or single quotes. There is no magic functionality or different escaping (e.g. no need for double quotes to use \n
or something).
In PHP we use both because of magic quotes, though in PHP we also prefer single quotes when magic functionality is not intended.