Created
July 10, 2017 13:45
-
-
Save becsegal/54c40c1a82124af0b48ab4ca03722ffd to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=54c40c1a82124af0b48ab4ca03722ffd
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Page Title</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
This file contains hidden or 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
| {"hiddenUIComponents":["output"]} |
This file contains hidden or 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
| var song = { | |
| title: 'Here Comes the Sun', | |
| artist: 'The Beatles', | |
| cover_image: 'http://cdn.thebeatles.com/sites/default/files/tile/image/original_593.jpg', | |
| spotify_url: 'https://open.spotify.com/track/6dGnYIeXmHdcikdzNNDMm2' | |
| }; | |
| // 3 ways to access the cover image | |
| console.log(song.cover_image); | |
| console.log(song['cover_image']); | |
| var key = 'cover_image'; | |
| console.log(song[key]); | |
| // Get all the keys and values without knowing anything about the object | |
| for (var key in song) { | |
| console.log("key: " + key + ", " + song[key]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment