Skip to content

Strings: single vs double quotes #34

@dpashkevich

Description

@dpashkevich

I use ExtJS library and they use single quotes everywhere. To me it's mostly a question of style except one good argument I've found so far: generating HTML. It's more convenient to use single quotes when you output html because html attributes are typically enclosed in double quotes:

    '<div class="calendar-popup" style="display: none;">',
        '<div class="calendar-popup-inner">',
        ...
        '</div>'
    '</div>'
];

I suggest a less strict guideline: just be consistent. Use whatever quotes you like but use them everywhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions