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

92
Visualizações
Map 2 arrays in Javascript

I'm trying to display the content of 2 arrays of contained in an object. When I map RType.information.Type the content of the array "Type" is displayed. But nothing happened if I want to display both (Type[] & Price[]). I tried many things but nothing works.. If someone is able to help lemme know!

JS CODE

 RType.information.Type.map(function (type) {
    RType.information.Price.map(function (price) {
    return m(
        m('td.item-name', m('h4', `CLASS: ${type}`)),
        m('td.item-name', m('h4', `PRICE: ${price}`)),
        ),
      )},
   )},

OBJECT

var RType = {
   information : {
      Type : ["value1", "value2"],
      Price : ["112", "200"],
   },
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Probably you're looking for something like this:

var RType = {
   information : {
      Type : ["value1", "value2"],
      Price : ["112", "200"],
   }};
   
RType.information.Type.map((e, i) => console.log('type: ' + e + ', price: '+ RType.information.Price[i]));

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