Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
Are JS objects a good option to store front & back flashcards with text and images for a good website performance?

I'm a begineer JS student and this is my first question in Stack.

I am looking to make a flashcard website with about 8000 Flashcards.

  • Are JS objects a good option or are there better options to make the site scalable and with a good/reasonable performance ?

In an old post (10 years ago) they recommend: AJAX-loading-one-at-a-time approach. (didn't learn that yet by the way).

So far I made 3 flashcards and it's working with variables and arrays but with 8000 not sure which is the best option:

function Card(term, definition) {
this.term = term;
this.definition = definition;
}

let front = document.getElementById("front");
let back = document.getElementById("back");
let flip = document.getElementById("flip");

const card1 = new Card(
  "Good Morning",
  "Buenos Dias"
);
const card2 = new Card(
  "Welcome",
  "Bienvenido"
);
const card3 = new Card(
  "How are you? ;)",
  "Que tal"
);

const myCards = [card1, card2, card3];
const cardIndex = 0;

Thank you in advance guys and sorry if I not explain well.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

As it is, what you're doing looks good to me... JSON is useful for storing data but I don't think what you're doing is wrong - it's just a matter of opinion.

When storing data like you are, I prefer to use this method:

const myCards = [
    {english: 'Good Morning', spanish: 'Buenos Dias'},
    {english: 'Welcome', spanish: 'Bienvenido'},
    {english: 'How are you?', spanish: 'Que tal?'}
]

const cardIndex = 0

console.log(myCards[cardIndex].english)
console.log(myCards[cardIndex].spanish)

This is a much smaller technique and it's very scalable.

Feel free to look further into JSON data if you like, but I don't think you need to worry.

I hope this helps.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda