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

125
Visualizações
Modulating a json key

i'm right now working with a cocktail API and fetch data out of json. My question is:

Is there a way to rename a json key for example it's original is "strIngredient1" and I want it to be just "strIngredient", so that I can count up to the last key with the same name but changing last number. My idea was to include all objects into one string without doing "ingr1" + "ingr2" + "ingr3" and so on:

var x = 1;

var ingr = data.drinks[0].strIngredient+x;

var ListIngr = "";

do{

x++;

ListIngr.innerHTML =+ ${ingr}

while(ingr != null);

I already searched a lot, but couldn't really find anything.I'm still new to working with Json.

JSON of the API

about 4 years ago · Juan Pablo Isaza
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