You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-2Lines changed: 55 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -474,7 +474,7 @@ function Familia(numeroDeIntegrantes,mascotas){
474
474
console.log(familia);
475
475
```
476
476
477
-

477
+

478
478
479
479
>Ahora que tenemos la `function` en el `__proto__` podemos hacerlo parte de otra función.
480
480
@@ -511,5 +511,58 @@ function Familia(numeroDeIntegrantes,mascotas){
511
511
512
512
console.log(familia);
513
513
```
514
+
### Consola (Google Chrome)
514
515
515
-

516
+

517
+
518
+
Como podemos observar todo funciona como era de esperarse y como *"heredamos"* podemos entender que podrias accesar a la `function` del `__prototype__` que hemos declarado.
519
+
520
+

521
+
522
+
```js
523
+
Uncaught TypeError:familia.tipoCasa is not a function
524
+
at <anonymous>:1:9
525
+
526
+
/*
527
+
Este error nos indica que no es una función a pesar de haber "heredado" "todo" lo que compone a la funcion 'Casa'.
528
+
529
+
Podemos revisar el __proto__ del objeto 'familia' y veremos que no existe en el.
530
+
531
+
Por lo tanto no heredados su __prototype__
532
+
*/
533
+
```
534
+
>Para heredar el `__prototype__` `realizaremos lo siguiente
0 commit comments