DEV Community

Mikesh Maharjan
Mikesh Maharjan

Posted on

" vs ' in JavaScript. Which one do you prefer?

Top comments (3)

Collapse
 
tobiassn profile image
Tobias SN

so I can use apostrophes without having to escape them. And it just looks better in my opinion.

Collapse
 
sergix profile image
Peyton McGinnis

Single quote. Faster to type since you don't have to hold down the shift key and ends up looking cleaner in my opinion.

Collapse
 
alvaromontoro profile image
Alvaro Montoro • Edited

I guess I'm old school: " for strings and ' for single chars.

...although it doesn't really matter because in the end, we have prettier and it unifies all of them into single quotes.