Turn An HTMLCollection Into An Array
Last updated
Was this helpful?
Last updated
Was this helpful?
If you are using any of the built-in document query utilities, such as :
Then you are going to get an in response. An instance of this cannot be iterated over, so you cannot call things like map
and filter
against it.
To use Array collection methods, you are first going to need to turn the HTMLCollection
into an array. You can do this with :