When a array is created using the array function as shown below.
Let array = Array(10);
And console logging the typeof array it shows object but why ?
typeof array
I saw this.
Arrays are also type of objects. If you want to identify if its array or not you can use Array.isArray() if you check the data types array is not defined
Array.isArray()