Created
March 4, 2019 14:25
-
-
Save krcrawford/720099e71726df6a0d72ebc9e8274222 to your computer and use it in GitHub Desktop.
Javascript Homework #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// attributes of a song | |
// song | |
const song = { | |
// artist | |
artist: { | |
firstName: 'Herbie', | |
lastName: 'Hancock', | |
}, | |
title: 'Stars in Your Eyes', | |
genre: 'jazz', | |
// album meta | |
album: { | |
number: 29, | |
title: 'Monster', | |
releaseDate: 1980, | |
songsInAlbum: [ | |
'Saturday Night', | |
'Stars in Your Eyes', | |
'Go for It', | |
'Don\'t Hold it In', | |
'Making Love', | |
'It All Comes Around' | |
], | |
}, | |
// duration | |
length: { | |
minutes: 7, | |
seconds: 5, | |
}, | |
// chart rankings | |
top40: { | |
ranked: false, | |
rank: null | |
}, | |
} | |
// log all of the data points to the console | |
console.log(song); | |
console.log(song.artist); | |
console.log(song.artist.firstName); | |
console.log(song.artist.lastName); | |
console.log(song.title); | |
console.log(song.genre); | |
console.log(song.album); | |
console.log(song.album.number); | |
console.log(song.album.title); | |
console.log(song.album.releaseDate); | |
console.log(song.album.songsInAlbum); | |
console.log(song.album.songsInAlbum[0]); | |
console.log(song.album.songsInAlbum[1]); | |
console.log(song.album.songsInAlbum[2]); | |
console.log(song.album.songsInAlbum[3]); | |
console.log(song.album.songsInAlbum[4]); | |
console.log(song.album.songsInAlbum[5]); | |
console.log(song.length); | |
console.log(song.length.minutes); | |
console.log(song.length.seconds); | |
console.log(song.top40); | |
console.log(song.top40.ranked); | |
console.log(song.top40.rank); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment