<html>
<head>
<title>Learning Javascript</title>
</head>
<body>
<h2>JavaScript Arrays</h2>
<p>Accessing the last array element in JS.</p>
<p id="demo"></p>
</body>
</html>
/* CSS */
var fruit=["apple","mango","strawberry","kiwi"];
var last = fruit[fruit.length-1];
document.getElementById("demo").innerHTML = last;