Home of web learners

www.webn3rd.com

array is used to store same kind of value

Lets make an array

<html>
<head>
    
</head>
<body>
    <script>
 
var color = ["red", "green", "blue"];
 document.write(color['0']);
    
</script>       
</body>
</html>

output:

red

Here,we declare an array variable named color,which having three data,its default indexing numerically

So,now we can use this array variable,by using its index,which indexed data we want to show

We want to show first data,as it starts from 0 index,so we can show like that

webn3rd.com

About webn3rd