gpt4 book ai didi

javascript - 数组不是 Javascript 中的数据类型?

转载 作者:行者123 更新时间:2023-11-30 08:15:54 25 4
gpt4 key购买 nike

根据 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

对吗?

最佳答案

这是正确的,Array只是 object 的后代。请注意,尽管它确实覆盖了一些东西,例如数组中的 .toString() 将其成员打印在逗号列表中,而不是像 "[Object object]"普通对象会。

关于javascript - 数组不是 Javascript 中的数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4148258/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com