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)
, 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:
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.