x
1
2
<html>
3
<body>
4
5
<h2>JavaScript Object Properties</h2>
6
<p>Access a property with .property:</p>
7
8
<p id="demo"></p>
9
10
<script>
11
const person = {
12
firstname: "osama",
13
lastname: "mohamed",
14
age: 50,
15
eyecolor: "blue"
16
};
17
18
document.getElementById("demo").innerHTML = person.firstname + " is " + person.age + " years old.";
19
</script>
20
21
</body>
22
</html>