Created
October 11, 2014 04:03
-
-
Save JacobHsu/694da4ecdf5c0e1e332a to your computer and use it in GitHub Desktop.
#JS You can also think of objects as combinations of key-value pairs (like arrays) // source http://jsbin.com/cuzaye/1
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> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var phonebookEntry = {}; | |
phonebookEntry.name = 'Oxnard Montalvo'; | |
phonebookEntry.number = '(555) 555-5555'; | |
phonebookEntry.phone = function() { | |
console.log('Calling ' + this.name + ' at ' + this.number + '...'); | |
}; | |
phonebookEntry.phone(); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var phonebookEntry = {}; | |
phonebookEntry.name = 'Oxnard Montalvo'; | |
phonebookEntry.number = '(555) 555-5555'; | |
phonebookEntry.phone = function() { | |
console.log('Calling ' + this.name + ' at ' + this.number + '...'); | |
}; | |
phonebookEntry.phone();</script></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
var phonebookEntry = {}; | |
phonebookEntry.name = 'Oxnard Montalvo'; | |
phonebookEntry.number = '(555) 555-5555'; | |
phonebookEntry.phone = function() { | |
console.log('Calling ' + this.name + ' at ' + this.number + '...'); | |
}; | |
phonebookEntry.phone(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment