Created
February 9, 2018 11:10
-
-
Save shreshthmohan/32164fc0fd247dd22d747f63c4797ca1 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/renunoqene
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<h1>Objects in JavaScript</h1> | |
<script id="jsbin-javascript"> | |
console.log('Objects are simply name-value pairs. A value can itself be a (collection of) name value pair(s).') | |
console.log('Take a look. See console.'); | |
const obj1 = { | |
address: { | |
city: 'Bangalore', | |
street: '22nd Cross', | |
apartment: { | |
floor: '4', | |
door: '402' | |
} | |
} | |
}; | |
console.log(obj1); | |
console.log('Aside: Syntax parser. {} is how the syntax parser know we are defining an object. Though there are other ways, like "new Object()", too.'); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">console.log('Objects are simply name-value pairs. A value can itself be a (collection of) name value pair(s).') | |
console.log('Take a look. See console.'); | |
const obj1 = { | |
address: { | |
city: 'Bangalore', | |
street: '22nd Cross', | |
apartment: { | |
floor: '4', | |
door: '402' | |
} | |
} | |
}; | |
console.log(obj1); | |
console.log('Aside: Syntax parser. {} is how the syntax parser know we are defining an object. Though there are other ways, like "new Object()", too.'); | |
</script></body> | |
</html> |
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
console.log('Objects are simply name-value pairs. A value can itself be a (collection of) name value pair(s).') | |
console.log('Take a look. See console.'); | |
const obj1 = { | |
address: { | |
city: 'Bangalore', | |
street: '22nd Cross', | |
apartment: { | |
floor: '4', | |
door: '402' | |
} | |
} | |
}; | |
console.log(obj1); | |
console.log('Aside: Syntax parser. {} is how the syntax parser know we are defining an object. Though there are other ways, like "new Object()", too.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment