4 ms·
I'm not sure why/when the shift took place, but I do like it because it looks a lot cleaner than double quotes. At work I use airbnb's linting configuration as
by sushid 11y ago
I'm not sure why/when the shift took place, but I do like it because it looks a lot cleaner than double quotes.
At work I use airbnb's linting configuration as shown here[1], which specifies the usage of single quotes for strings (no explanation for the preference though).
[1] https://github.com/airbnb/javascript https://github.com/airbnb/javascript
- __derek__ 11y agoIn speculating on reasons behind the preference, my best guess is HTML. It seems more natural/idiomatic to write: var el = $('<a href="/" class="link">Link</a>'); rather than var el = $("<a href='/' class='link'>Link</a>"); let alone var el = $("<a href=\"/\" class=\"link\">Link</a>");
- exprx 11y agoIn this particular case, I'd write var el = $("<a href=/ class=link>Link</a>");