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

122
Vistas
JavaScript object has different value in source page than in console

So my application is wrote in java and Spring and I need to pass a hash map with [data,value] from backend to frontend , using THYMELEAF, so I can render them into a graph. These are my lines in my controller

model.addAttribute("hashValues",resultHash.values());
model.addAttribute("hashTime",resultHash.keySet());

When trying to access them in javascript, the hashValues seem to be right, but the time list has a problem. When using console.log to print hashTime my console says something like [1996,1997,1997] when in reality my dates are [2021-10-15, 2021-10-14, 2021-10-13]. I will add some images for a better understanding.

This is how I get the lists from the model.

 var time = [[${hashTime}]]
 var values = [[${hashValues}]]
 console.log(time)
 console.log(values)

See THIS IMAGE

I've tried using JSON.parse but I have the same problem. Any help is appreciated cause I've been working with JavaScript for some time and I never encountered this type of problem before.

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