Skip to content

Redundant complexity of find function #1

@elszczepano

Description

@elszczepano

Is there any reason to write find() function in this way?

const result = [];
const docs = text.match(GOOGLE_DOCS_REGEXP);
result.push(...docs);
return result;

I've tested this function with some different cases and I didn't find any reason to write this function in this way. It can be done much easier:

const result = text.match(GOOGLE_DOCS_REGEXP);
return result;

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