Writing array code

Writing array code:

<script>
var x =[23, 34, 43, 44, 43];
for (var i = 0; i < 4; i++)
document.write(x[i]);
</script>

 

 

var x = [65, 98, 49 , 40, 39];
for (var i = x.length; i > 0 ; i--)
document.write(x[i] + "in ");
document.getElementById("demo").innerHTML = x[i];

 

Leave a Reply

Your email address will not be published. Required fields are marked *