Boolean Array

An array with only boolean values is called Boolean Array.

Example

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

index.html

</>
Copy
<!doctype html>
<html>
<body>
    <h2>JavaScript - Boolean Array</h2>
    <pre id="output"></pre>
    
    <script>
        var indicators = [true, true, false];
        document.getElementById("output").innerHTML = indicators;
        document.getElementById("output").innerHTML += "indicators[2] : " + indicators[2];
    </script>
    
</body>
</html>