¡Te damos la bienvenida a este reto!

1

¡Bienvenido al mundo de JavaScript!

Día 1

2

Variables, funciones y sintaxis básica

3

Tipos de datos

4

Playground - Retorna el tipo

5

Tipos de datos - pt 2

Día 2

6

Operadores

7

Hoisting y coerción

8

Playground - Calcula la propina

9

Alcance de las variables

Día 3

10

Condicionales

11

Playground - Calcula años bisiestos

12

Switch

13

Playground - Obten información de mascotas según su tipo

14

Ciclos

15

Playground - Dibuja un triangulo

Día 4

16

Arrays

17

Playground - Encuentra al michi mas famoso

18

Objetos

19

Playground - Obten el promedio de los estudiantes

Día 5 - Checkpoint

20

Playground - encuentra el palindromo más grande

Día 6

21

Reasignación y redeclaración

22

Modo estricto

Día 7

23

Debugging y manejo de errores

24

Programación funcional

Quiz: Día 7

Día 8

25

Closures

26

Playground - Crea una calculadora con closures

27

Higher order functions

28

Playground - Crea tu propio método map

Día 9

29

ECMAScript

30

TC39

Quiz: Día 9

Día 10 - Checkpoint

31

ES6

32

ES7

33

Playground - Task planner

Día 11

34

Asincronismo

35

Playground - Promesas

36

Manejando el asincronismo

37

Playground - Resuelve el callback hell usando promesas

38

Playground - Resuelve el callback hell usando async/await

Día 12

39

Arrays a profundidad

40

Métodos de arrays: Every, Find y findIndex

41

Playground - Válida el formulario

Día 13

42

Métodos de arrays: Includes, Join y concat

43

Playground - agrupa los productos

44

Métodos de arrays: Flat y FlatMap

45

Playground - Encuentra la ubicación del valor buscado

Día 14

46

Mutable functions

47

Playground - Modifica una lista de compras

48

Métodos de arrays: sort

49

Playground - Ordena los productos

Día 15 - Checkpoint

50

Playground - Sistema de reservaciones de un hotel

Día 16

51

Programación orientada a objetos en JavaScript

52

Objetos literales

53

Playground - Congela el objeto recursivamente

Día 17

54

Prototipos en JavaScript

55

Playground - Modifica el prototype de los arrays

56

Playground - Crea un auto usando clases

Día 18

57

Abstracción en JavaScript

58

Playground - Sistema de carrito de compras

59

Encapsulamiento en JavaScript

60

Playground - Encapsula datos de los usuarios

Día 19

61

Herencia en JavaScript

62

Playground - Jerarquía de animales

63

Polimorfismo en JavaScript

64

Playground - Sistema de pagos

Día 20 - Checkpoint

65

Playground - Agenda de vuelos

Día 21

66

Patrones de diseño

67

Sinlgeton y Factory pattern en JavaScript

68

Playground - Implementa singleton en un chat

Día 22

69

Adapter y Decorator pattern en JavaScript

70

Playground - Personaliza productos de una tienda

71

Builder y Protype pattern en JavaScript

72

Playground - Mejora el código usando builder pattern

Día 23

73

Facade y proxy pattern en JavaScript

74

Playground - Proxy en servicio de mensajería

75

Chain of responsability y Observer pattern en JavaScript

76

Playground - Implementación de Observador en Newsletter

Día 24 - Checkpoint

77

Playground - Crea un task manager con patrones de diseño

Día 25

78

Estructuras de datos en JavaScript

79

Playground - Crea tu propia implementación de un array

80

Hash tables en JavaScript

81

Playground - Implementación de una HashTable para Contactos

Día 26

82

Set en JavaScript

83

Playground - Remueve duplicados de una lista

84

Maps en JavaScript

85

Playground - Crea un organizador de tareas

Día 27

86

Singly Linked List en JavaScript

87

Playground - Agrega métodos a la singly linked list

88

Playground - Implementación de una singly linked list

Día 28

89

Stacks en JavaScript

90

Playground - Crea un stack para una playlist

Día 29

91

Queues en JavaScript

92

Playground - Crea una cola de emails

Día 30

93

¡Lo lograste!

Live Class

94

30 días de JS con Juan DC

95

30 días de JS con Nicobytes

96

30 días de JS con GNDX

97

30 días de JS con LeoCode

98

30 días de JS con Teffcode

99

Sesión: Cierre de los 30 días de JavaScript

No tienes acceso a esta clase

¡Continúa aprendiendo! Únete y comienza a potenciar tu carrera

Playground - Implementación de Observador en Newsletter

76/99

Aportes 35

Preguntas 1

Ordenar por:

¿Quieres ver más aportes, preguntas y respuestas de la comunidad?

🛡️🛡️Escudo anti-spoilers🛡️🛡️

Mi solución al reto:

Archivo: exercise.js

export class Newsletter {
 subscribers = []

 subscribe(subscriber) {
   this.subscribers.push(subscriber)
 }

 unsubscribe(email) {
   let indexToRemove = this.subscribers.findIndex((s) => s.email === email)
   return this.subscribers.splice(indexToRemove, 1);
 }

 post(article) {
   for (let s of this.subscribers) {
     s.receive(article)
   }
 }
}

Archivo: Subscriber.js

export class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

exercises.js

export class Newsletter {
  // Tu código aquí 👈
  constructor() {
    this.subscribers =[]
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber)
    console.log(`Se ha suscrito el usuario con correo ${subscriber.email}`)
  }
  
  unsubscribe(email) {
    const index = this.subscribers.findIndex(el => el.email === email);
    if (index !== -1) {
      this.subscribers.splice(index, 1);
      console.log(`Se ha eliminado de la lista de suscriptores el usuario con correo ${email}`);
    }
    
  }
  post(article) {
    console.log(`Se ha publicado un nuevo artículo: ${article.title}`);
    console.log(`Contenido: ${article.content}`)
    this.subscribers.forEach(subscriber => subscriber.receive(article));
  }
}

Subscriber.js

export class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log(`El usuario con correo ${this.email} ha recibido el artículo ${article.title}`);
  }
  
}

ez el tutorial en veldad

exercise.js

export class Newsletter {
  subscribers = []
  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }
  unsubscribe(email) {
    const index = this.subscribers.findIndex(item => item.email === email)
    this.subscribers.splice(index,1)
  }
  post(article) {
    this.subscribers.forEach(sub => sub.receive(article))
  }
}

subcriber.js

export class Subscriber {
  constructor(email) {
    this.email = email
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}
Super agradecido de que redactaron bien este reto. Aquí les comparto mi solución: ![](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExM3l5d2JuZW1tbDA5Z2duMHhxanBnNWk0c3c5MWthNXEya2Yzc3E0NCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/dLolp8dtrYCJi/giphy.gif) ![](https://static.platzi.com/media/user_upload/code-5aa4c1e8-fa22-4f74-8125-25fbc0e2d7c7.jpg)

Mi solución:
.
.
.
.
.
.
.
.
.
Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    return console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    const subIndex = this.subscribers.findIndex(sub => sub.email == email);
    this.subscribers.splice(subIndex, 1);
  }

  post(article) {
    this.subscribers.forEach(sub => sub.receive(article));
  }
}

💚 Mi solución💚

🛡️ MURO ANTI-SPOILERS 🛡️

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = []
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }

  unsubscribe(email){
    let indexToDelete = this.subscribers.findIndex(subscriber => subscriber.email === email)
    if (indexToDelete === -1)
      throw new Error("Email no suscrito")
    this.subscribers.splice(indexToDelete, 1)
  }

  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article))
  }

}

🛡️🛡️Escudo anti-spoilers🛡️🛡️
.
.
.
.
.
.
.
.
.
.
.

class Newsletter {
    // Tu código aquí 👈
    constructor(){
        this.subscribers = [];
    }

    subscribe(subscriber){
        this.subscribers.push(subscriber);
    }

    unsubscribe(email){
        this.subscribers = this.subscribers.filter(subscriber => subscriber.email !== email);
    }

    post(article){
        this.subscribers.forEach(subscriber => subscriber.receive(article));
    }
}
class Subscriber {
    // Tu código aquí 👈
    constructor(email){
        this.email = email;
    }

    receive(article){
        console.log(`El suscriptor ${this.email}  ha recibido el artículo: ${article.title}`);
    }
}

//Ejemplo
//Input:

const newsletter = new Newsletter();
const subscriber1 = new Subscriber("[email protected]");
const subscriber2 = new Subscriber("[email protected]");
const subscriber3 = new Subscriber("[email protected]");

const article = {
    title: "30 días de js",
    content: "Aprende js en 30 días"
}

newsletter.subscribe(subscriber1);
newsletter.subscribe(subscriber2);
newsletter.subscribe(subscriber3);

newsletter.post(article);

/*Output:
"El suscriptor [email protected] ha recibido el artículo: 30 días de js"
"El suscriptor [email protected] ha recibido el artículo: 30 días de js"
"El suscriptor [email protected] ha recibido*/

🛡️🛡️🛡️Escudo anti spoilers🛡️🛡️🛡️

Implementación de observador en newsletter

Subscriber.js

export class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    return `El suscriptor ${this.email} ha recibido el artículo: ${article.title}`;
  }
}

exercise.js


export class Newsletter {
  // Tu código aquí 👈
  constructor() {
    this.subscribers = [];
    this.articles = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(
      (subscriber) => subscriber.email != email
    );
  }
  post(article) {
    this.articles.push(article);
    this.subscribers.forEach((subscriber) => subscriber.receive(article));
  }
}

// Subscriber.js
export class Subscriber {
  constructor(email) {
    this.email = email
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

// Exercise.js
export class Newsletter {
  constructor() {
    this.subscribers = []
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }
  unsubscribe(email) {
    const index = this.subscribers.findIndex(s => s.email === email)
    this.subscribers.splice(index, 1)
  }
  post(article) {
    this.subscribers.forEach(s => s.receive(article))
  }
}

export class Subscriber {
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}
export class Newsletter {
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    const index = this.subscribers.findIndex(subscriber => subscriber.email === email);
    if (index !== -1) {
      this.subscribers.splice(index, 1);
    }
  }

  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article));
  }
}

Hola dejo mi solución al Reto:

Subscriber.js

export class Subscriber {

  constructor(email) {
    this.articles = [];
    this.email = email;
  }

  receive(article) {
    this.articles.push(article);
    console.log(
      `El suscriptor ${this.email} ha recibido el artículo: ${article.title}`
    );
  }
}

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(
      (subscriber) => subscriber.email !== email
    );
  }

  post(article) {
    this.subscribers.forEach((subscriber) => subscriber.receive(article));
  }
}

Solución

class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log(
      `Suscriber ${this.email}, received the ${article.title} article.`
    );
  }
}

class Newsletter {
  // Tu código aquí 👈
  subscribers = [];

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    const deletedSubscriberIndex = this.subscribers.findIndex(
      (sub) => sub.email === email
    );
    this.subscribers.splice(deletedSubscriberIndex, 1);
  }

  post(article) {
    this.subscribers.forEach((sub) => sub.receive(article));
  }
}

.
.
.
.
.
.

export class Subscriber {
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

.
.
.
.

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(subscriber => subscriber.email !== email);
  }

  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article));
  }
}


.
.
.
.
.
.

Subscriber.js

 class Subscriber {
  // OBSERVADOR
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

exercise.js

export class Newsletter {
  //OBSERVABLE:
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    const removedSubscriber = this.subscribers.findIndex((subscriber) => subscriber.email === email)
    return this.subscribers.splice(removedSubscriber, 1);
  }

  post(article) {
    this.subscribers.forEach(subscriber => {
      subscriber.receive(article);
    });
  }
}

otro mas, ya me quedan menos
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

exercise.js

export class Newsletter {
  // Tu código aquí 👈
  constructor() {
    this.subscribers = []
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(sub => sub.email !== email)
  }
  post(article) {
    this.subscribers.forEach(sub => sub.receive(article));
  }
}

Subscriber.js

export class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    console.log(`El subscriptor ${this.email} ha recibido un: ${article.title}`);
  }
}

Mi solución
.
.
.
.
.
.
.
.
.
.
.
.
.
.

class Newsletter {
  // Tu código aquí 👈
  constructor(){
    this.subscribers = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  } 
  unsubscribe(email) {
    const index = this.subscribers.findIndex((item) => item.email === email);
    this.subscribers.splice(index, 1)
  }
  post(article){
    this.subscribers.forEach((subscriber) => subscriber.receive(article));
  }
}

class Subscriber{
  constructor(email) {
    this.email = email;
  }
  receive(article){
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

Mi solución:
fui feliz por lograrlo a la primera 😄 (aunque igual estaba fácil)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
exercise.js

export class Newsletter {
    constructor() {
        this.subscribers = [];
      }
      subscribe(subscriber) {
        this.subscribers.push(subscriber);
      }
      unsubscribe(email) {
        const toDelete = this.subscribers.findIndex(subscriber => {
          subscriber.email = email
        })
        this.subscribers.splice(toDelete, 1);
      }
      post(article){
        this.subscribers.forEach(subscriber=> {
            subscriber.receive(article);
        })
      }
}

Subscriber.js

export class Newsletter {
    constructor() {
        this.subscribers = [];
      }
      subscribe(subscriber) {
        this.subscribers.push(subscriber);
      }
      unsubscribe(email) {
        const toDelete = this.subscribers.findIndex(subscriber => {
          subscriber.email = email
        })
        this.subscribers.splice(toDelete, 1);
      }
      post(article){
        this.subscribers.forEach(subscriber=> {
            subscriber.receive(article);
        })
      }
}

MI SOLUCION 💪
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
class Subscriber

export class Subscriber {
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

class Newsletter

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    const index = this.subscribers.findIndex(subscribe => subscribe.email === email);
    this.subscribers.splice(index, 1);
  }

  post(article) {
    this.subscribers.forEach(subscribe => subscribe.receive(article));
  }
}

Bueno aportando mi solución:

.
.
.
.
.
.
.
.
.
.
.

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = []
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }

  unsubscribe(email) {
    const pos = this.subscribers.findIndex(subscriber => subscriber.email === email)
    this.subscribers.splice(pos, 1)
  }

  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article))
  }

}

Mi solución:
.
.
.
.
.
.
.
.
.
.
.
.

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

excercise.js

export class Newsletter {
  constructor() {
    this.subscribers = []
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }

  unsubscribe(email) {
    const subscriberIndex = this.subscribers.findIndex(subscriber => subscriber.email === email)
    this.subscribers.splice(subscriberIndex, 1)
  }

  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article))
  }
}

Aquí mi solución:
.
.
.
.
.
.
.
.
.
.
.

exercise.js

export class Newsletter {
  constructor(){
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    let index = this.subscribers.findIndex(elem => elem.email === email);
    if (index >= 0) {
      this.subscribers.splice(index, 1);
    }
  }

  post(article) {
    return this.subscribers.map(elem => elem.receive(article));
  }
}

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log("El suscriptor " + this.email + " ha recibido el artículo: " + article.title);
  }
}

Sabro… 😃

export class Newsletter {
  // Tu código aquí 👈    
  constructor() {
    this.subscribers = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    let index = this.subscribers.findIndex(subscriber => subscriber.email === email);
    this.subscribers.splice(index, 1);
  }
  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article));
  }
}
export class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo:${article.title}`)
  }
}

La solución a la que llegue:
:
:
:
:
:
:
:
:
Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}
 

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(sub => sub.email != email);
  }
  post(article) {
    this.subscribers.map(sub => sub.receive(article));
  }
}

extrañamente salio muy facil o estoy mejorando… jajajaja

export class Subscriber {
  // Tu código aquí 👈
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  };
} 

class Newsletter {
  // Tu código aquí 👈

  constructor() {
    this.subscribers = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    let index = this.subscribers.findIndex((value) => value.email == email);
    if (index === -1) throw new Error("mail no existe");
    return this.subscribers.splice(index, 1)[0];
  }
  post(article) {
    for (let elemento of this.subscribers) {
      elemento.receive(article);
    }
  }
}

El post de mi solucion
.
.
.

.
.
.
.
.

.
.
.
.
.

export class Newsletter {
    constructor() {        
        this.subscribers = []
    }
    subscribe(subscriber) {
        this.subscribers.push(subscriber)
    }
    unsubscribe(email) {
        this.subscribers.splice(this.subscribers.indexOf(email), 1)
    }
    post(article) {
        this.subscribers.forEach(subscriber => subscriber.receive(article))
    }
}

export class Subscriber {
    constructor(email) {
        this.email = email
    }
    receive(article) {
        console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);

    }
}

Mi solución:
.
.
.
.
.
.
Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email
  }

  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = []
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }

  unsubscribe(email) {
    this.subscribers = this.subscribers.filter((sub) => sub.email !== email)
  }

  post(article) {
    this.subscribers.forEach((subscriber) => subscriber.receive(article))
  }
}

Mi solución.

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

exercise.js

export class Newsletter {
  subscribers = [];
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    let deleted = this.subscribers.findIndex(x => x.email === email);
    this.subscribers.splice(deleted, 1);
  }
  post(article) {
    this.subscribers.forEach(x => x.receive(article));
  }
}

Solución… 😄
.
.
.
.

.
Subcriber.js:
.

export class Subscriber {
  constructor(email) { 
    this.email = email;
  }

  receive(article) { 
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

.
exercise.js:
.

export class Newsletter {
  constructor() { 
    this.subscribers = [];
  }

  subscribe(subscriber) { 
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) { 
    let index = this.subscribers.findIndex(sub =>
      sub.email === email
    );
    this.subscribers.splice(index, 1);
  }

  post(article) { 
    this.subscribers.forEach(sub =>
      sub.receive(article)
    );
  }
}

Gracias Dios me salió a la primera!
.
:
:
:
:
:
:
:
:
:
:

export class Subscriber {
    constructor(email) { 
      this.email = email
    }
    receive(article) { 
      console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
    }
  }

  export class Newsletter {
    constructor() {
      this.subscribers = [];
    }
  
    subscribe(subscriber) { 
      this.subscribers.push(subscriber);
    }
  
    unsubscribe(email) { 
      let index = this.subscribers.findIndex(x => x.email == email)
      this.subscribers.splice(index, 1);
    }
    post(article) { 
      this.subscribers.forEach(x => { 
        x.receive(article);
      })
    }
  }

Mi solución:
.
.
.
.
.
.
exercise.js:

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }
  unsubscribe(email) {
    this.subscribers.splice((this.subscribers.findIndex(subscriber=>subscriber.email===email)),1)
  }
  post(article) {
    this.subscribers.forEach((subscriber) => {
      subscriber.receive(article)
    })
  }
}

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`)
  }
}

Mi Respuesta
.
exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(subscriber => subscriber.email !== email);
  }

  post(article) {
    this.subscribers.forEach(subscriber => subscriber.receive(article));
  }
}

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email;
  }

  receive(article) {
    console.log('El suscriptor ' + this.email + ' ha recibido el artículo: '+article.title);
  }
}

Les comparto mi solución. 😄

Subscriber.js

export class Subscriber {
  email;
  articles = [];
  constructor(email) {
    this.email = email;
  }
  receive(article) {
    this.articles.push(article);
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

exercise.js

export class Newsletter {
  subscribers = [];
  articles = [];
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }
  unsubscribe(email) {
    const { subscribers } = this;
    const INDEX = subscribers.findIndex((subscriber) => subscriber.email === email);
    subscribers.splice(INDEX, 1);
  }
  post(article) {
    const { subscribers } = this;
    this.articles.push(article);
    for (let i = 0; i < subscribers.length; i++) {
      subscribers[i].receive(article);
    }
  }
} 

Mi solución:
código Subscribers.js:

export class Subscriber {
  constructor(email) {
    this.email = email
  }
  receive(article) {
    console.log(`El suscriptor ${this.email} ha recibido el artículo: ${article.title}`);
  }
}

código exercise.js:

export class Newsletter {
  constructor() {
    this.subscribers = [];
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
    return this;
  }
  unsubscribe(email) {
    this.subscribers.splice(this.subscribers.indexOf(email), 1);
    return this;
  }
  post(article) {
    this.subscribers.forEach(subscriber => {
      subscriber.receive(article)
    })
  }
}

Mi Solución
*
*
*
*
*
*
*
Subscriber

export class Subscriber {
  constructor(email) {
    this.email = email
  }

  receive(article) {
    return `El suscriptor ${this.email} ha recibido el artículo: ${article.title}`
  }
}

Newsletter

export class Newsletter {
  constructor() {
    this.subscribers = []
  }

  subscribe(subscriber) {
    this.subscribers.push(subscriber)
  }

  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(x => x.email !== email)
  }

  post(article) {
    this.subscribers.forEach(x => x.receive(article))
  }

}

Subscriber.js

export class Subscriber {
  constructor(email) {
    this.email = email
  }

  receive(article) {
    const msg = `El suscriptor ${this.email} ha recibido el artículo: ${article.title}`
    console.log(msg)
    return msg
  }
}

exercise.js

export class Newsletter {
  constructor() {
    this.subscribers = []
  }
  subscribe(subscriber) {
    this.subscribers.push(subscriber);
  }

  unsubscribe(email) {
    this.subscribers = this.subscribers.filter(s => s.email !== email)
    
  }

  post(article) {
    this.subscribers.forEach(s => s.receive(article))
  }

}

undefined