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

148
Vistas
Javascript object desctructuring

I'm completely new to Javascript and building a booking calendar for car rental page and not sure how to get specific values out of object. I googled Javascript Object desctructuring, but only found out how to console.log all of the keys.

I have following code which outputs objects values (pic related)

$(this).datepicker('setUTCDates', newDates);
console.log(newDates)

enter image description here

, but I'm trying to get only the date, which I thought would be done with

$(this).datepicker('setUTCDates', newDates);
console.log(newDates.getDay())

However, I'm getting getDay() function doesn't exist.

I also tried putting this into Map:

$(this).datepicker('setUTCDates', newDates);
const obj = newDates;
const map = new Map(Object.entries(obj));
console.log(map); 

, but getting following output:

enter image description here

Now I'm not sure how to scrape out only value from given key. I'm also not sure what I'm looking at when I open the console and skimming through object, if anyone can point me out to read upon that I'd be thankful.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

try this:

$(this).datepicker('setUTCDates', newDates);
newDates.map(date => console.log(date.getDay());

newDates is an array. so, first, you have to loop through the array and console each item or item property or method. that will work for sure.

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