【发布时间】:2019-07-10 22:54:30
【问题描述】:
我的代码有什么问题?
let x = ['hello',1]
let y = [2]
let z = {x:"hello",y:2}
console.log("type of x:",typeof x) // expected array!
console.log("type of y:",typeof y) // expected array!
console.log("type of z:",typeof z) // expected object, ok
结果:
type of x: object
type of y: object
type of z: object
【问题讨论】:
-
哎呀,抱歉造成污染!我在考虑 JSON 原语 而不是 Javascript 原语。
标签: node.js