• Post Reply Bookmark Topic Watch Topic
  • New Topic

instanceOf() method

 
Mahalakshmi Chandru
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I have a doubt in the below code. Somebody please clarify:



Foo [ ].instanceOf(Foo, Bar, Face) -> false // correct
Foo [ ].instanceOf(Object) -> true // correct
Foo [ 1 ].instanceOf(Foo, Bar, Face, Object) -> true // how???
 
sebastian tortschanoff
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An ArrayObject of type Foo is just an Arry-Object, like this:



cause, you can't say, that the ArrayObject is a Foo, or Bar or Face

-> true

when the Object in Foo[1] is i.e. a Foo-Object

 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!