Skip to content

String-building is a bad pattern in js #10

@thujone

Description

@thujone

urlString += `&latitude=${lat1}&longitude=${lng1}`;

The += operator used to build strings is kind of a no-no in modern web development. It makes errors hard to debug because the string could be changed in any number of lines. It's better to turn the string-building into ES6 templates. Or assemble strings into different variables, and at the end assemble all the variables.

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