【发布时间】:2012-01-30 03:04:08
【问题描述】:
你能设置一个ECMAScript对象的the internal [[Class]] property吗?
【问题讨论】:
-
请注意,内部的 [[Class]] 属性将在 ES6 中被移除。
-
@Raynos 有趣。那么
Array.isArray()和类似的函数将如何工作呢? -
不确定,他们会使用一些合理的检测,可能是
Array.protototype.isPrototypeOf(someArray); -
@JoshSmith
function isArray(x) { return [].concat(x)[0] !== x; };)
标签: javascript