Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    It doesn’t do anything in that situation. Array.from never returns null or undefined. But if an array is empty, iterating over it doesn’t do anything anyway.
    – Ry-
    Commented Mar 16, 2022 at 3:32
  • @Ry- Appreciate the explanation. So if myArray is empty to begin with, then this part of the code will not crash out - correct?
    – ArthurJ
    Commented Mar 16, 2022 at 3:39
  • 2
    Right. And if it’s already an array, there’s no need to use Array.from either.
    – Ry-
    Commented Mar 16, 2022 at 4:43