index.html
<!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>