Say I have an object like this:
const recordCollection = {
2548: {
albumTitle: 'Slippery When Wet',
artist: 'Bon Jovi',
tracks: ['Let It Rock', 'You Give Love a Bad Name']
},
2468: {
albumTitle: '1999',
artist: 'Prince',
tracks: ['1999', 'Little Red Corvette']
},
1245: {
artist: 'Robert Palmer',
tracks: []
},
5439: {
albumTitle: 'ABBA Gold'
}
};
I know I can print a single property like this:
console.log (recordCollection[2548]['artist'];
And I wonder whether it is possible to do something like this:
console.log (recordCollection[2548]['artist', 'tracks'];
How would I print both artist and tracks?