Numeric Array

An array with only numeric values is called numeric array.

Example

In the following example, we initialize an Array with numbers, and access its elements using index.

index.html

<!doctype html>
<html>
<body>
    <h2>JavaScript - Numeric Array</h2>
    <pre id="output"></pre>
    
    <script>
        <!-- JavaScript goes here -->
        var numbers = [12, 56, 8];
        document.getElementById("output").innerHTML = numbers + '\n';
        document.getElementById("output").innerHTML += "numbers[1] : " + numbers[1];
    </script>
	
</body>
</html>