DEV Community

Mikesh Maharjan
Mikesh Maharjan

Posted on

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

Top comments (3)

tobiassn profile image
Tobias SN

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

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.

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.