Class checking: "instanceof" by cortizg · Pull Request #175 · javascript-tutorial/es.javascript.info · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 1-js/09-classes/06-instanceof/1-strange-instanceof/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ importance: 5

---

# Strange instanceof
# Extraño instanceof

In the code below, why does `instanceof` return `true`? We can easily see that `a` is not created by `B()`.
En el siguiente código, ¿por qué `instanceof` devuelve `true`? Podemos ver fácilmente que `a` no es creado por `B()`.

```js run
function A() {}
Expand All @@ -15,6 +15,6 @@ A.prototype = B.prototype = {};
let a = new A();

*!*
alert( a instanceof B ); // true
alert( a instanceof B ); // verdadero
*/!*
```
148 changes: 74 additions & 74 deletions 1-js/09-classes/06-instanceof/article.md