Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!