-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrays_js.html
More file actions
30 lines (27 loc) · 765 Bytes
/
Copy patharrays_js.html
File metadata and controls
30 lines (27 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!Doctype html>
<html>
<head>
<title>JavaScript Arrays</title>
</head>
<body>
<p id="demo"></p>
<p id="arr1"></p>
<p id="arr2"></p>
<p id="objects"></p>
<script>
var cars = ["BMW", "Volvo", "Audi", "Sable"];
var person = {
firstName: "john",
lasName: "Doe",
age: 25,
eyeColor: "blue"
};
document.getElementById("demo").innerHTML = cars[2];
document.getElementById("arr1").innerHTML = cars[3];
document.getElementById("arr2").innerHTML = cars[0];
document.getElementById("objects").innerHTML = person.firstName +
person.lasName + " " + "is" + " " + person.age +
" " + "years old.";
</script>
</body>
</html>