Object.getPrototypeOf(arguments) VS [[Class]]

Andrea Giammarchi andrea.giammarchi at gmail.com
Wed Nov 28 09:18:10 PST 2012


null ...

function isArguments(object) {
  return -1 < {}.toString.call(object).indexOf(" Arguments]") || (
    !!object && typeof object == "object" && !(object instanceof Object)
  );
}

On Wed, Nov 28, 2012 at 9:13 AM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:

> function isArguments(object) {
>   return -1 < {}.toString.call(object).indexOf(" Arguments]") || (
>     typeof object == "object" && !(object instanceof Object)
>   );
> }
>
> alert([
>   isArguments({}),
>   isArguments(function(){return arguments}())
> ]);
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121128/c5a1c7d2/attachment.html>


More information about the es-discuss mailing list