+ 4
What the type of arrays in javascript
6 Answers
+ 5
console.log(typeof [ ])
//Outputs: object đ
+ 3
Homogeneous, Heterogeneous, Multidimensional and Jagged
+ 3
If you wanna check that whether something is an array or not, you can use this:
let words = "not an array"
console.log(Array.isArray(words)) // false
+ 1
David Carroll [].constructor === Array is the best way to determine if it's an array or object.
+ 1
Ah... my answer might have given the impression that I wasn't sure why the output is object. I've changed my emoticon from đ¤ˇââď¸ to đ.
I was trying to convey to the OP...
"Is this what you're asking?"
But it just looked like I didn't understand the output. đ¤Śââď¸