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

149
Visualizações
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 Respostas
Responde à pergunta

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