Newsgroups: comp.lang.javascript
From: kj <so...@987jk.com.invalid>
Date: Sun, 27 Jan 2008 21:47:54 +0000 (UTC)
Local: Sun, Jan 27 2008 4:47 pm
Subject: "x.constructor == Foo" vs "x instanceof Foo"
My book (Flanagan's JavaScript: The Definitive Guide, 5th ed.) ( x.constructor == Foo ) and ( x instanceof Foo ) The author states that the instanceof operator computes its result However, I've recently ran into a situation that contradicts this. I've been trying to understand jQuery better, with the aid of x instanceof jQuery is true, but x.constructor == jQuery is false. In fact, x.constructor is Object, but (Object instanceof jQuery) Could anyone explain to me what's going on? TIA! Kynn -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
