javascript中Array的类型为什么是object
发布网友
发布时间:2022-04-22 15:02
我来回答
共3个回答
热心网友
时间:2022-04-22 16:32
就是object,它是原生对象,他能够new一个实例。
热心网友
时间:2022-04-22 17:50
写了代码测试了下
<script>
document.write ("typeof(1): "+typeof(1)+"<br>");
document.write ("typeof(NaN): "+typeof(NaN)+"<br>");
document.write ("typeof(Number.MIN_VALUE): "+typeof(Number.MIN_VALUE)+"<br>")
document.write ("typeof(Infinity): "+typeof(Infinity)+"<br>")
document.write ("typeof(\"123\"): "+typeof("123")+"<br>")
document.write ("typeof(true): "+typeof(true)+"<br>")
document.write ("typeof(window): "+typeof(window)+"<br>")
document.write ("typeof(document): "+typeof(document)+"<br>")
document.write ("typeof(null): "+typeof(null)+"<br>")
document.write ("typeof(eval): "+typeof(eval)+"<br>")
document.write ("typeof(Date): "+typeof(Date)+"<br>")
document.write ("typeof(sss): "+typeof(sss)+"<br>")
document.write ("typeof(undefined): "+typeof(undefined)+"<br>")
</script>
结果如下
typeof(1): number
typeof(NaN): number
typeof(Number.MIN_VALUE): number
typeof(Infinity): number
typeof("123"): string
typeof(true): boolean
typeof(window): object
typeof(document): object
typeof(null): object
typeof(eval): function
typeof(Date): function
typeof(sss): undefined
typeof(undefined): undefined
希望对你有帮助 望采纳
热心网友
时间:2022-04-22 19:24
给你一句话,js 万物皆对象