In this article , Array is collection of elements or items
Array javascript: Array Literal
Example:
Array is JavaScript Keyword:Javascript Array
Create array using the keyword
We have lot of array method in Javascript
Array javascript: Array Literal
Example:
<script>
var animals=["lion","tiger","car"];
for (i=0;i< animals.length;i++){
document.write(animals [i] + "<br/>");
}
</script>
Array is JavaScript Keyword:Javascript Array
Create array using the keyword
Var animals= new Array();
animals [0] = "Lion";
animals [1] = "Tiger";
animals [2] = "Cat";
for (i=0;i<animals.length;i++){
document.write(animals [i] + "<br>");
}
We have lot of array method in Javascript
1 Comments
Need more detail from the blog like push and pop in array
ReplyDelete