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

89
Vistas
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 Respuestas
Responde la pregunta

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 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