Skip to content

Commit 358423e

Browse files
authored
Merge pull request #274 from cortizg/es.javascript.info.1-09-02-ci
Class inheritance
2 parents 6324b44 + caa08db commit 358423e

File tree

5 files changed

+171
-171
lines changed

5 files changed

+171
-171
lines changed

1-js/09-classes/02-class-inheritance/1-class-constructor-error/solution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
That's because the child constructor must call `super()`.
1+
Eso es porque el constructor hijo debe llamar a `super()`.
22

3-
Here's the corrected code:
3+
Aqui el código corregido:
44

55
```js run
66
class Animal {
@@ -21,7 +21,7 @@ class Rabbit extends Animal {
2121
}
2222

2323
*!*
24-
let rabbit = new Rabbit("White Rabbit"); // ok now
24+
let rabbit = new Rabbit("Conejo Blanco"); // ahora funciona
2525
*/!*
26-
alert(rabbit.name); // White Rabbit
26+
alert(rabbit.name); // Conejo Blanco
2727
```

1-js/09-classes/02-class-inheritance/1-class-constructor-error/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# Error creating an instance
5+
# Error al crear una instancia
66

7-
Here's the code with `Rabbit` extending `Animal`.
7+
Aquí está el código de la clase `Rabbit` que extiende a `Animal`.
88

9-
Unfortunately, `Rabbit` objects can't be created. What's wrong? Fix it.
9+
Desafortunadamente, los objetos `Rabbit` no se pueden crear. ¿Que pasa? Arréglalo.
1010
```js run
1111
class Animal {
1212

@@ -24,7 +24,7 @@ class Rabbit extends Animal {
2424
}
2525

2626
*!*
27-
let rabbit = new Rabbit("White Rabbit"); // Error: this is not defined
27+
let rabbit = new Rabbit("Conejo Blanco"); // Error: esto no está definido
2828
*/!*
2929
alert(rabbit.name);
3030
```

1-js/09-classes/02-class-inheritance/2-clock-class-extended/source.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
clock.start();
88

99

10-
/* Your class should work like this: */
10+
/* Tu clase debería funcionar así: */
1111

1212
/*
1313

1-js/09-classes/02-class-inheritance/2-clock-class-extended/task.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ importance: 5
22

33
---
44

5-
# Extended clock
5+
# Reloj extendido
66

7-
We've got a `Clock` class. As of now, it prints the time every second.
7+
Tenemos una clase de 'Clock'. A partir de ahora, imprime la hora cada segundo.
88

99

1010
[js src="source.view/clock.js"]
1111

12-
Create a new class `ExtendedClock` that inherits from `Clock` and adds the parameter `precision` -- the number of `ms` between "ticks". Should be `1000` (1 second) by default.
12+
Crea una nueva clase `ExtendedClock` que herede de `Clock` y agrega el parámetro `precision`: este es el número de `milisegundos` entre "tics". Debe ser `1000` (1 segundo) por defecto.
1313

14-
- Your code should be in the file `extended-clock.js`
15-
- Don't modify the original `clock.js`. Extend it.
14+
- Tu código debe estar en el archivo `extended-clock.js`
15+
- No modifiques el `clock.js` original. Extiéndelo.

0 commit comments

Comments
 (0)