Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda