Попробуй это!
<script>
let colors = ["Red", "Green", "Blue"];
alert(colors[2]);
</script>
или более общий:
<script>
let colors = ["Red", "Green", "Blue"];
//Output: Blue (Note that arrays starts with 0)
PrintArrayValue(colors, 2);
function PrintArrayValue(array, index){
alert(array[index]);
}
</script>