'How can I change the property of a nested object like so?

const album3 = {
  title: 'Fear of Music',
  albumDetails: {
    released: 'August 3, 1979',
    label: 'Sire',
    formats: ['Cassette']
  }
};

question: Update the released property of album3 from a string into a Date object using that string.

I have tried many variations of something like this:

album3.albumDetails.Date = album3.albumDetails.released


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source