r/javascript • • Apr 01 '18

Google publishes a JavaScript style guide. Here are some key lessons.

https://medium.freecodecamp.org/google-publishes-a-javascript-style-guide-here-are-some-key-lessons-1810b8ad050b
714 Upvotes

317 comments sorted by

View all comments

24

u/e_man604 Apr 01 '18

Why is single quote (') preferred over double quote (") ? For me it makes sense to use double to remain same when dealing with c++ for instance.

14

u/ghostfacedcoder Apr 01 '18

This is a JS style guide, not a C++ style guide :) In Javascript the single quote is by far the most common one used by the community.

1

u/e_man604 Apr 01 '18

Yes but ' in c++ is char and not string, so its two different things. Sorry if it was a bit weird but I only wondered why single quote was popular by Js community.

I guess it's not to press shift, as others said.

1

u/shaggy756 Apr 01 '18

Yeah anybody arguing that it's faster is full of it.