We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c610517 commit d617a18Copy full SHA for d617a18
doc/instanceof.md
@@ -8,9 +8,14 @@ nearly as useless as the [typeof operator](#typeof).
8
9
function Foo() {}
10
function Bar() {}
11
- Bar.prototype = Foo;
+ Bar.prototype = new Foo();
12
13
new Bar() instanceof Bar; // true
14
+ new Bar() instanceof Foo; // true
15
+
16
+ // This just sets Bar.prototype to the function object Foo
17
+ // But not to an actual instance of Foo
18
+ Bar.prototype = Foo;
19
new Bar() instanceof Foo; // false
20
21
### Using `instanceof` with native types
0 commit comments