CodingTrain / CodingTrain/Suggestion-Box

p5.js tutorial - advanced arrays (jagged 2d array of objects)

Abierto
#397 1 comentario 0 reacciones 0 asignados Ver en GitHub
Help wanted Suggestion
Lenguaje dominante
Sin datos de lenguaje
Estrellas
570
Forks
85
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

A follow up to tutorial 9.12: 2D Arrays in JavaScript

Data doesn't always come in neat 4x7 element packages; sometimes it is irregular. I'm not entirely sure what the represented limits are in p5.js - I believe you can make an array of arrays, but how about when dimensions get jagged? Or an array of jagged arrays of objects?

Consider one example: gift boxes under a Christmas tree.
A box might be represented as an object with several properties -

- recipient
- an array of things inside

You might want to organize them several ways -
the simplest is an array of all boxes, but what if you wanted an array of Senders, and each element of this array contained an array of boxes sent by them.

Would this be possible to represent? How would one enumerate the various arrays, or get the lengths?

What would the syntax be for the length of a Sender list?

If boxes[sender][item] was the syntax for one item, how would one get the number of items from a sender? How would one get the number of senders?

Could this data be extended to include an item name and cost? These things periodically haunt my dreams...

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start by reviewing tutorial 9.12, “2D Arrays in JavaScript,” and the examples described in this issue. Define the scope for an advanced tutorial covering jagged arrays, arrays of objects, nested indexing, and retrieving collection lengths. Done means the tutorial clearly explains and demonstrates the proposed gift-box data structure and its questions.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
documentation
Tipo de issue
Documentación
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.