The simplest array that we can make is a one-dimensional array with a predetermined size. Below, I demonstrate how to declare an array of 5 elements and fill it with 5 integers. Then I print each element via the array access operator [] and an integer index.
<!DOCTYPE html>
<html>
<head>
<title>XoaX.net's Javascript</title>
</head>
<body>
<script type="text/javascript" src="SimpleArrays.js"></script>
</body>
</html>var iaA = [2,3,6,9,2];
document.writeln("iaA["+ 0 + "] = " + iaA[0] + "<br />");
document.writeln("iaA["+ 1 + "] = " + iaA[1] + "<br />");
document.writeln("iaA["+ 2 + "] = " + iaA[2] + "<br />");
document.writeln("iaA["+ 3 + "] = " + iaA[3] + "<br />");
document.writeln("iaA["+ 4 + "] = " + iaA[4] + "<br />");© 20072025 XoaX.net LLC. All rights reserved.