identify intrinsic function

Is there a way in javascript to identify if an object
has an explicitly defined 'toString' function or if
that toString is an intrinsic one?

thanks,rf.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

0
rufoo2001
7/10/2003 5:27:09 AM
netscape.mozilla.jseng 1530 articles. 0 followers. Follow

1 Replies
143 Views

Similar Articles

[PageSpeed] 45

Rufoo wrote:

>Is there a way in javascript to identify if an object
>has an explicitly defined 'toString' function or if
>that toString is an intrinsic one?
>

You could use the ECMA-262 Edition 3 standard method, hasOwnProperty, to 
decide whether an object has its own direct property (rather than 
delegates to a prototype object for the given property id):

  if (o.hasOwnProperty('someId')) ...

/be

0
Brendan
7/10/2003 5:59:53 PM
Reply: