0

I created a HTMLCollection by using the method document.getElementsByClassName and I know that it returns an Object. But when I converted that object into Array using the Array.from method and then checked its type, it still shows the type as of Object. While I'm able to perform the array operations upon the same.

Why is it so? enter image description here

himank
  • 21
  • 4
  • 3
    Arrays **are** objects. Even if you do `typeof []` you'll get the same result. If you want to test whether an array is an array instead of any other data type, then use `Array.isArray()`. – Daedalus Sep 02 '23 at 05:46

0 Answers0