According to Professional Javascript for Web developers array is not a datatype in Javascript:
❑ “undefined” if the value is undefined
❑ “boolean” if the value is a Boolean
❑ “string” if the value is a string
❑ “number” if the value is a number
❑ “object” if the value is an object or null
❑ “function” if the value is a function
Is that correct?
This is correct, Array is just a descendant of object
. Note though it does override a few things, for example .toString()
in an array prints it's members in a comma list, instead of "[Object object]"
like a plain object would.
I believe that is because an "Array" is an "object"
http://jsfiddle.net/z5Gv2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With