¡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 una HashTable para Contactos

81/99

Aportes 28

Preguntas 0

Ordenar por:

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

Michis anti-spoilers

Fue algo muy parecido a la lectura, simplemente tomar en cuenta como se accede al valor, mediante el metodo hash, entonces de esa manera se puede realizar las diferentes operaciones.

export class ContactList {
  constructor(size) {
    // Tu código aquí 👈
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    console.log(total % this.numBuckets);
    return total % this.numBuckets;
  }

  insert(name, phone) {
    // Tu código aquí 👈
    let index = this.hash(name)
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }
    this.buckets[index].push([name, phone])
  }

  get(name) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.buckets[index]) {
      return null
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1]
      }
    }
  }

  retrieveAll() {
    // Tu código aquí 👈
    let allValues = []
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push(this.buckets[i][j])
        }
      }
    }

    return allValues
  }

  delete(name) {
    // Tu código aquí 👈
    let index = this.hash(name)
    console.log(index);
    if (!this.buckets[index]) {
      return null
    }
    if (this.buckets[index]) {
      this.buckets[index] = []
    }
  }
}

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

Busqué hacer todos mis métodos con menos de 4 lineas de código 👀 (el número de lineas de código no indican si un algoritmo es mejor o peor) simplemente ‘a veces’ menos código es más claro y rápido de leer, a veces, no siempre…
Mi solución:

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) total += name.charCodeAt(i);
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name)
    if (!this.buckets[index]) this.buckets[index] = [];
    this.buckets[index].push([name, phone])
  }

  get(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) return null
    return this.buckets[index].find(b => b[0] === name)[1]
  }

  retrieveAll() {
    return this.buckets.filter(b => b.length > 0).flat()
  }

  delete(name) {
    let index = this.hash(name)
    if (!this.buckets[index]) return null
    if (this.buckets[index]) delete this.buckets[index]
  }
}

Mi solución:

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }

    this.buckets[index].push([name, phone]);
  }

  get(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }
    return null;
  }

  retrieveAll() {
    let allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push([this.buckets[i][j][0],this.buckets[i][j][1]]);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return delete this.buckets[index];
      }
    }
    return null;
  }
}

La practica hace el maestro 🤓! ![](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExenZweHpseXVvcTlkam1kY2xpdml1ZmlzeTgyYTUxa2ZsY2pwYmZuaSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/26B5K5rQtILiqnSYU/giphy.gif)![]() ![](https://static.platzi.com/media/user_upload/code-0a75022a-ad74-4256-837a-fed8da8243d2.jpg)

Comparto mi solucion:

export class ContactList {
constructor(size) {
// Tu código aquí 👈
this.buckets = new Array(size);
this.numBuckets = this.buckets.length;
}

hash(name) {
let total = 0;
for (let i = 0; i < name.length; i++) {
total += name.charCodeAt(i);
}
return total % this.numBuckets;
}

insert(name, phone) {
// Tu código aquí 👈
let index = this.hash(name);
if (!this.buckets[index]) {
this.buckets[index] = [];
};
this.buckets[index].push([name, phone]);
}

get(name) {
// Tu código aquí 👈
let index = this.hash(name);
if (!this.buckets[index]) {
return null;
};
for (let i = 0; i < this.buckets[index].length; i++){
if (this.buckets[index][i][0] === name) {
return this.buckets[index][i][1];
}
}
}

retrieveAll() {
// Tu código aquí 👈
let allValues = [];
for (let i = 0; i < this.numBuckets; i++){
if (this.buckets[i]) {
for (let j = 0; j < this.buckets[i].length; j++){
allValues.push(this.buckets[i][j]);
}
}
}
return allValues;
}

delete(name) {
// Tu código aquí 👈
let index = this.hash(name);
console.log(index);
if (!this.buckets[index]) {
return null;
};

if (this.buckets[index]) {
  this.buckets[index] = [];
}

}
}


.
.
.
.
.
.
Bastante similar a la lectura así que intuitivo.

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }
    this.buckets[index].push([name, phone]);
  }

  get(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      return null;
    }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }
  }

  retrieveAll() {
    let all = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          all.push(this.buckets[i][j]);
        }
      }
    }
    return all;
  }

  delete(name) {
    let index = this.hash(name)
    if (!this.buckets[index]) {
      return null;
    } else {
      this.buckets[index] = [];
    }
  }
}

💚Mi solución💚

🛡️MURO ANTI-SPOILERS🛡️


Mi implementación en cuanto a el constructor los métodos hash() e insert() son prácticamente como los de la lectura 80.
Sin embargo, los métodos get(), retrieveAll() y delete() trate de usar los métodos de Array para mejorar la legibilidad y hacerlos un tanto más cortos. Además me aseguré de validar todos los casos posibles.

👾Código

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size)
    this.numBuckets = this.buckets.length
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const index = this.hash(name)

    if (!this.buckets[index])
      this.buckets[index] = []

    this.buckets[index].push([name,phone])
  }

  get(name) {
    const index = this.hash(name)

    if (!this.buckets[index])
      return null

    const element = this.buckets[index].find(element => element[0] === name)

    if(element)
      return element[1]
    else
      return null
  }

  retrieveAll() {
    return this.buckets.filter(element => element).flat()
  }

  delete(name) {
    const index = this.hash(name)

    if (!this.buckets[index])
      return null

    const elementIndex = this.buckets[index].findIndex(element => element[0] === name)

    if (elementIndex != -1) 
      this.buckets[index].splice(elementIndex,1)
    else
      return null
  }
}

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

export class ContactList {
  constructor(size) {
    // Tu código aquí 👈
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    // Tu código aquí 👈
    const index = this.hash(name);

    if (!this.buckets[index]) this.buckets[index] = [];

    this.buckets[index].push([name, phone]);
  }

  get(name) {
    // Tu código aquí 👈
    const index = this.hash(name);

    if (!this.buckets[index]) return null;

    for (let i = 0; i < this.buckets[index].length; i++){
      if (this.buckets[index][i][0] === name) return this.buckets[index][i][1];
    }

    return null;
  }

  retrieveAll() {
    // Tu código aquí 👈
    const allBuckets = [];

    for (let i = 0; i < this.numBuckets; i++){
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++){
          allBuckets.push(this.buckets[i][j]);
        }
      }
    }

    return allBuckets;
  }

  delete(name) {
    // Tu código aquí 👈
    const index = this.hash(name);

    if (!this.buckets[index]) return null;

    const internalIndex = this.buckets[index].findIndex(bucket => bucket[0] === name);

    if (internalIndex < 0) return null;

    this.buckets[index].splice(internalIndex, 1);
  }
}

Solución

class ContactList {
  constructor(size) {
    // Tu código aquí 👈
    this.contacts = new Array(size);
    this.numBuckets = this.contacts.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    // Tu código aquí 👈
    const index = this.hash(name);

    if (!this.contacts[index]) this.contacts[index] = [];

    this.contacts[index].push([name, phone]);
  }

  get(name) {
    // Tu código aquí 👈
    const index = this.hash(name);
    const bucket = this.contacts[index];

    if (!bucket) return undefined;
    for (let i = 0; i < bucket.length; i++) {
      if (bucket[i][0] === name) return bucket[i][1];
    }
    return undefined;
  }

  retrieveAll() {
    // Tu código aquí 👈
    const retrievedContacts = [];
    this.contacts.forEach((contact) => {
      if (!contact) return;
      contact.forEach((pair) => retrievedContacts.push(pair));
    });
    return retrievedContacts;
  }

  delete(name) {
    // Tu código aquí 👈
    const index = this.hash(name);
    const bucket = this.contacts[index];
    if (!bucket) return undefined;

    for (let i = 0; i < bucket.length; i++) {
      if (bucket[i][0] === name) {
        const deletedPair = bucket.splice(i, 1)[0];
        return deletedPair;
      }
    }
    return undefined;
  }
}
export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }

    this.buckets[index].push([name, phone]);
    return this.buckets[index];
  }

  get(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++){
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }

    return null;
    
  }

  retrieveAll() {
    let allValues = [];
    for (let i = 0; i < this.numBuckets; i++){
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++){
          allValues.push(this.buckets[i][j]);
        }
      }
    }
    console.log(allValues);
    return allValues;
  }

  delete(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        this.buckets[index] = [];
      }
    }

    return null;
  }
}

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const index = this.hash(name);
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }

    this.buckets[index].push([name, phone]);
  }

  get(name) {
    const index = this.hash(name);
    if (!this.buckets[index]) {
      return null;
    }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }
    return null;
  }

  retrieveAll() {
    const allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push(this.buckets[i][j]);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    const index = this.hash(name);
    if (!this.buckets[index]) {
      return null;
    }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        this.buckets[index].splice(i, 1);
        return;
      }
    }
  }
}

.
.
. SPOILERS
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name)
    if (!this.buckets[index]) this.buckets[index] = [];
    this.buckets[index].push([name, phone])
  }

  get(name) {
     let index = this.hash(name);
     if (!this.buckets[index]) return null
     return this.buckets[index].find(bucket => bucket[0] === name)[1]
  }

  retrieveAll() {
    let allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let value of this.buckets[i]) {
          allValues.push(value);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    let index = this.hash(name)
    if (!this.buckets[index]) return null
    if (this.buckets[index]) delete this.buckets[index]
  }
}

Hola Comparto la solución, estaba bien explicado en el anterior clase…









export class ContactList {
  constructor(size) {
    // Dentro del constructor se inicializa un array con un tamaño arbitrario
    // Para asignarlo como el tamaño total de buckets en nuestra hashTable
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    // Esta función toma un "name"
    // Para poder calcular el índice del bucket donde el valor será almacenado
    let total = 0;
    // En este caso el algoritmo para crear un hash es muy sencillo

    // Para calcular el hash, se suman los valores ASCII de cada caracter de la key
    // y se toma el resto de la división de esta suma entre el total de buckets.

    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    // Este método toma el "name" y un value que seria el phone, y los almacena en la hash table
    // Primero se calcula el índice usando la función hash
    const index = this.hash(name);

    // si ese bucket no existe, se inicializa como un array vacío.
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }

    // Luego se agrega un arreglo con la key y el value al bucket
    this.buckets[index].push([name, phone]);
  }

  get(name) {
    // Esta función toma una key que es el atributo "name"
    // y retorna el valor almacenado en la hash table
    // Primero se calcula el índice usando la función hash
    const index = this.hash(name);

    // si ese bucket no existe, se retorna null.
    if (!this.buckets[index]) {
      return null;
    }

    // Si el bucket existe, se recorre el array en busca de un arreglo
    // que tenga la key especificada
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }

    //Si no se encuentra la key, se retorna null.
    return null;
  }

  retrieveAll() {
    // Esta función retorna un array con todos los valores almacenados
    // Se recorren todos los buckets y, si existen, se agrega cada value a un array
    const allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push(this.buckets[i][j]);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    const index = this.hash(name);

    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        this.buckets[index].splice(i, 1);
        return;
      }
    }
  }
}

Mas corto mas comprensible.

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }
  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }
  insert(name, phone) {
    let index = this.hash(name)
    if (!this.buckets[index]) this.buckets[index] = []
    this.buckets[index].push([name, phone]);
  }
  get(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) return null
    return this.buckets[index].find(value => value[0] === name)[1]
  }
  retrieveAll() {
    return this.buckets.filter(b => b.length > 0).flat()
  }
  delete(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) return null
    delete this.buckets[index]
  }
}

,
,
,
,
,
,
,

,
,
,
,
,

export class ContactList {
  constructor(size) {
    this.size = size
    this.buckets = new Array(size)
  }

  hash(name) {
    let hash = 0
    for (let i = 0; i < name.length; i++) {
      hash += name.charCodeAt(i)
    }
    return hash % this.size
  }

  insert(name, phone) {
    const index = this.hash(name)
    if (!this.buckets[index]) {
      this.buckets[index] = []
    }
    this.buckets[index].push([name, phone])
  }

  get(name) {
    const index = this.hash(name)
    if (this.buckets[index]) {
      for (let i = 0; i < this.buckets[index].length; i++) {
        if (this.buckets[index][i][0] === name) {
          return this.buckets[index][i][1]
        }
      }
    }
    return null
  }

  retrieveAll() {
    const result = []
    for (let i = 0; i < this.buckets.length; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          result.push(this.buckets[i][j]);
        }
      }
    }
    return result
  }

  delete(name) {
    const index = this.hash(name)
    if (this.buckets[index]) {
      for (let i = 0; i < this.buckets[index].length; i++) {
        if (this.buckets[index][i][0] === name) {
          this.buckets[index].splice(i, 1)
          return
        }
      }
    }
    return null
  }
}

Solución… 😄
.
Tener cuidado con el método retrieveAll(), puesto que en la lectura devuelve todos los valores.
.
Es decir los “[i][j][1]”, mientras que el reto solo pide devolver todos los valores como: [name, phone] donde se incluye la clave también, por lo que corresponde a todos los “[i][j]”.
.

.
.
Solución:
.

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }

    this.buckets[index].push([name, phone]);
  }

  get(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }

    return null;
  }

  retrieveAll() {
    let allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push(this.buckets[i][j]);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null;
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        this.buckets[index].splice(i, 1);
      }
    }

    return null;
  }
}

Lo hice!!!
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

export class ContactList {
  constructor(size) {
    // Tu código aquí 👈
    this.contacts = new Array(size);
    this.numBuckets = this.contacts.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.contacts[index])
      this.contacts[index] = [];
    this.contacts[index].push([name, phone]);
  }

  get(name) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.contacts[index])
      return null;
    for (let i = 0; i < this.contacts[index].length; i++) {
      if (this.contacts[index][i][0] === name)
        return this.contacts[index][i][1];
      else return null;
    }
    return null;
  }

  retrieveAll() {
    // Tu código aquí 👈
    let allContacts = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.contacts[i]) {
        for (let j = 0; j < this.contacts[i].length; j++)
          allContacts.push(this.contacts[i][j]);
      }
    }
    return allContacts;
  }

  delete(name) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.contacts[index])
      return null;
    this.contacts[index] = [];
  }
}
 

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

class ContactList {
  constructor(size) {
    // Tu código aquí 👈
    this.contacts = new Array(size);
    this.numContacts = this.contacts.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numContacts;
  }

  insert(name, phone) {
    // Tu código aquí 👈
    const index = this.hash(name);
    if (!this.contacts[index]){
      this.contacts[index] = [];
    }
    this.contacts[index].push([name,phone]);
  }

  get(name) {
    let index = this.hash(name);
    if (!this.contacts[index]) return null
		
    for (let i = 0; i < this.contacts[index].length; i++) {
      if (this.contacts[index][i][0] === name) {
        return this.contacts[index][i][1];
      }
    }
  }

  retrieveAll() {
    // Tu código aquí 👈
    let allValues = [];
    for (let i = 0; i < this.numContacts; i++) {
      if (this.contacts[i]) {
        for (let j = 0; j < this.contacts[i].length; j++) {
          allValues.push(this.contacts[i][j]);
				}
			}
		}
		// Para finalmente retornarlo.
		return allValues;
  }

  delete(name) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.contacts[index]) return null
		
    for (let i = 0; i < this.contacts[index].length; i++) {
      this.contacts[index].splice(i, 1);
    }
  }
}

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

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }
    this.buckets[index].push([name, phone]);
  }

  get(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      return null
    }
    for (const contact of this.buckets[index]) {
      if (contact[0] === name) {
        return contact[1];
      }
    }
  }

  retrieveAll() {
    let allValues = [];
    for (const bucket of this.buckets) {
      if (bucket) {
        for (const element of bucket) {
          allValues.push(element);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      return null
    }
    let found = false;
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        this.buckets[index].splice(i, 1);
        found = true;
      }
    }

    if (!found) {
      return null
    }
  }
}

MI SOLUCION 💪
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const index = this.hash(name);
    if (!this.buckets[index]) this.buckets[index] = [];
    this.buckets[index].push([name, phone]);
  }

  get(name) {
    const index = this.hash(name);
    if (!this.buckets[index]) return null;
    const contact = this.buckets[index].find(bucket => bucket[0] === name);
    return contact ? contact[1] : null;
  }

  retrieveAll() {
    return this.buckets.flat();
  }

  delete(name) {
    const index = this.hash(name);
    if (!this.buckets[index]) return null;
    const indexContact = this.buckets[index].findIndex(bucket => bucket[0] === name)
    if (indexContact === -1) return null;
    delete this.buckets[index][indexContact]
  }
}

Bueno dejo de aporte mi solución

.
.
.
.
.
.
.
.
.
.
.

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const pos = this.hash(name)
    if (!this.buckets[pos]) this.buckets[pos] = []
    this.buckets[pos].push([name, phone])
    return this.buckets[pos]
  }

  get(name) {
    const pos = this.hash(name)
    if (!this.buckets[pos]) return null
    const findContact = this.buckets[pos].find(bucket => bucket[0] === name)
    console.log(findContact)
    return findContact ? findContact[1] : null
  }

  retrieveAll() {
    return this.buckets.flat()
  }

  delete(name) {
    const pos = this.hash(name)
    if (!this.buckets[pos]) return null
    const indexContact = this.buckets[pos].findIndex(bucket => bucket[0] === name)
    delete this.buckets[pos][indexContact]
  }
}

listo

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size)
    this.nbuckets = this.buckets.length
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const index = this.hash(name)
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }
    this.buckets[index].push([name, phone])
  }

  get(name) {
    const index = this.hash(name)
    if (!this.buckets[index]) {
      return null
    }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {

        return this.buckets[index][i][1]
      }
      else {
        return null
      }
    }

  }

  retrieveAll() {

    return this.buckets[NaN] || []
  }
  delete(name) {
    const index = this.buckets[NaN].findIndex(item => item.includes(name))
    this.buckets[NaN].splice(index, 1)
  }
}

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

export class ContactList {
  constructor(size) {
    this.list = new Array(size)
    this.numBuckets = this.list.length
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const index = this.hash(name)
    if (!this.list[index]) {
      this.list[index] = []
    }
    this.list[index].push([name, phone])
  }

  get(name) {
    const index = this.hash(name)
    if (!this.list[index]) {
      return null
    }
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.list[index][i][0] === name) {
        return this.list[index][i][1]
      }
    }
  }

  retrieveAll() {
    const retreivedData = []
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.list[i]) {
        retreivedData.push(this.list[i])
      }
    }
    return retreivedData.flat()
  }

  delete(name) {
    const index = this.hash(name)
    if (!this.list[index]) {
      return null
    }
    const nameIndex = this.list[index].findIndex(contact => contact[0] === name)
    delete this.list[index][nameIndex]
  }
}

Mi solución:

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }
    this.buckets[index].push([name, phone]);
    return this.buckets[index];
  }

  get(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null
    }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }
    return null;
  }

  retrieveAll() {
    let allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push(this.buckets[i][j]);
        }
      }
    }
    // Para finalmente retornarlo.
    return allValues;
  }

  delete(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null
    }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index].length == 0) {
        this.buckets[index] = []
        return this.buckets;
      }
      if (this.buckets[index][i][0] === name) {
        const contact = this.buckets[index].splice(i, 1);
        return contact;
      }
    }
  }
}

Sin problemas, solo pensar el metodo delete:

export class ContactList {
  constructor(size) {
    this.contacts = new Array(size);
    this.numContacts = this.contacts.length;
  }

  hash(name) {
    let total = 0;

    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numContacts;
  }
  insert(name, phone) {
    let index = this.hash(name);
    if (!this.contacts[index]) {
      this.contacts[index] = [];
    }
    this.contacts[index].push([name, phone]);

  }
  get(name) {
    let index = this.hash(name);

    if (!this.contacts[index]) {
      return null;
    }
    for (let i = 0; i < this.contacts[index].length; i++) {
      if (this.contacts[index][i][0] === name) {
        return this.contacts[index][i][1];
      }
    }
    return null;
  }

  retrieveAll() {
    let allphones = [];
    for (let i = 0; i < this.numContacts; i++) {
      if (this.contacts[i]) {
        for (let j = 0; j < this.contacts[i].length; j++) {
          allphones.push(this.contacts[i][j]);
        }
      }
    }
    return allphones;
  }

  retrieveAll() {
    // Tu código aquí 👈
    let allValues = []
    for (let i = 0; i < this.numContacts; i++) {
      if (this.contacts[i]) {
        for (let j = 0; j < this.contacts[i].length; j++) {
          allValues.push(this.contacts[i][j])
        }
      }
    }

    return allValues
  }

  delete(name) {
    // Tu código aquí 👈
    let index = this.hash(name);
    if (!this.contacts[index]) {
      return null;
    }
    for (let i = 0; i < this.contacts[index].length; i++) {
      if (this.contacts[index][i][0] === name) {
        this.contacts[index] = [];
        return;
      }
    }
  }
} 

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

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size);
    this.numBuckets = this.buckets.length;
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    let index = this.hash(name);
    if (!this.buckets[index]) {
      this.buckets[index] = [];
    }

    this.buckets[index].push([name, phone]);
  }

  get(name) {
    debugger
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1];
      }
    }

    return null;
  }

  retrieveAll() {
    debugger
    let allValues = [];
    for (let i = 0; i < this.numBuckets; i++) {
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          allValues.push(this.buckets[i][j]);
        }
      }
    }
    return allValues;
  }

  delete(name) {
    let index = this.hash(name);

    if (!this.buckets[index]) {
      return null
    }

    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        this.buckets[index] = [];
        return;
      }
    }

    return null;
  }
}

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

export class ContactList {
  constructor(size) {
    this.buckets = new Array(size)
    this.numBuckets = this.buckets.length
  }

  hash(name) {
    let total = 0;
    for (let i = 0; i < name.length; i++) {
      total += name.charCodeAt(i);
    }
    return total % this.numBuckets;
  }

  insert(name, phone) {
    const index = this.hash(name)
    if (!this.buckets[index]) { this.buckets[index] = [] }
    this.buckets[index].push([name, phone])
  }

  get(name) {
    const index = this.hash(name)
    if (!this.buckets[index]) { return null }
    for (let i = 0; i < this.buckets[index].length; i++){
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index][i][1]
      }
    }
    return null
  }

  retrieveAll() {
    let values = []
    for (let i = 0; i < this.numBuckets; i++){
      if (this.buckets[i]) {
        for (let j = 0; j < this.buckets[i].length; j++) {
          values.push(this.buckets[i][j])
        }
      }
    }
    return values
  }

  delete(name) {
    const index = this.hash(name)
    if (!this.buckets[index]) { return null }
    for (let i = 0; i < this.buckets[index].length; i++) {
      if (this.buckets[index][i][0] === name) {
        return this.buckets[index].splice(i, 1)
      }
    }
    return null
  }
}

Mi solucion
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

export class ContactList {
        constructor(size) {
        this.buckets = new Array(size)
        this.numBuckets = this.buckets.length
    }

    hash(name) {
        let total = 0;
        Array.from(name).forEach((e, i) => total += name.charCodeAt(i))
        return total % this.numBuckets;
    }

    insert(name, phone) {
        let index = this.hash(name)

        if (!this.buckets[index]) {
            this.buckets[index] = []
        }
        this.buckets[index].push([name, phone])
    }

    get(name) {
        let index = this.hash(name)

        if (!this.buckets[index]) {
            return null
        }
        const findName = this.buckets[index].find(bucket => bucket[0] === name)
        if (findName) {
            return findName[1];
        }
        return null
    }

    retrieveAll() {
        let allValues = []
        for (let i = 0; i < this.buckets.length; i++) {
            if (this.buckets[i]) {
                this.buckets[i].forEach(bucket => {
                    allValues.push(bucket)
                })
            }
        }
            return allValues
        }

        delete (name) {
            let index = this.hash(name)

            if (!this.buckets[index]) {
                return null
            }
            const nameIndex = this.buckets[index].findIndex(bucket => bucket[0] === name)
            if (nameIndex !== -1) {
                this.buckets[index].splice(nameIndex, 1)
                }
            return null
        }
    }
undefined