Everyone has their own style. As long as they are consistent, then that would be fine. Would like to see some style guide about it that has been used by people around the world.
To me, I will use single-quote string by default. If it has a potential to have only single-quote character in it, then I would use double-quote so that I can remove the escape character.
I use double-quote to represent empty string because it feels more assertive. As to type it requires me to press the Shift key.
I think this is just a personal preference. No?
Everyone has their own style. As long as they are consistent, then that would be fine. Would like to see some style guide about it that has been used by people around the world.
To me, I will use single-quote string by default. If it has a potential to have only single-quote character in it, then I would use double-quote so that I can remove the escape character.
I use double-quote to represent empty string because it feels more assertive. As to type it requires me to press the Shift key.
Example:
Second time I see someone using Yoda comparison π
eslint.org/docs/2.0.0/rules/yoda
I don't use it personally, it's just funny to me.