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 ?
I saw this.
CodePudding user response:
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