<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>JavaScript Tipe Data Array</title>
</head>
<body>
    <script>
    // Membuat array
    var warna = ["Merah", "Kuning", "Hijau", "Orange"];
    var kota = ["Jakarta", "Medan", "Bandung"];
    
    // Cetak nilai array
    document.write(warna[0] + "<br>");   // Output: Merah
    document.write(kota[2]);   // Output: Bandung
    </script>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.