Skip to content

Array.from isn't faster than the spread element #69

Closed
@fregante

Description

@fregante

The readme says:

Use Array.from instead of [...iterable] for performance benefits.

but it doesn't appear to be correct.

https://www.measurethat.net/Benchmarks/Show/1721/0/arrayfrom-vs-spread

Array.from is just different in that it works on array-like objects, but it's actually ever-so-slightly slower in all browsers I tested.

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