DEV Community

Mikesh Maharjan
Mikesh Maharjan

Posted on

1 2

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

Top comments (3)

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.

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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay