他のすべてのビルトインは、グローバル オブジェクトにアタッチされます。
> Object.prototype.toString.call(new Date)
'[object Date]'
> new Date instanceof Date
true
> Object.prototype.toString.call(new Function)
'[object Function]'
> new Function instanceof Function
true
> Object.prototype.toString.call(new Number)
'[object Number]'
> new Number instanceof Number
true
Arguments
、しかし、そうではありません:
> args = null; (function() { args = arguments }()); Object.prototype.toString.call(args)
'[object Arguments]'
> new Arguments instanceof Arguments
ReferenceError: Arguments is not defined
アクセスする方法はありますか?