I'm new to javascript and have been trying to teach myself the basics. I do have some experience with C++.

I came across this example in the source I'm using for studying and the for loop looks strange to me:

```
<html>
<head>
<script type="text/javascript">
<!--
function ReadCookie()
{
   var allcookies = document.cookie;
   alert("All Cookies : " + allcookies );

   // Get all the cookies pairs in an array
   cookiearray  = allcookies.split(';');

   // Now take key value pair out of this array
   for(var i=0; i<cookiearray.length; i++){
      name = cookiearray[i].split('=')[0];
      value = cookiearray[i].split('=')[1];
      alert("Key is : " + name + " and Value is : " + value);
   }
}
//-->
</script>
</head>
<body>
<form name="myform" action="">
<input type="button" value="Get Cookie" onclick="ReadCookie()"/>
</form>
</body>
</html>

```

Would someone mind explaining why there is a [0] and [1] near the end of these statements? 

name = cookiearray[i].split('=')[0];
 value = cookiearray[i].split('=')[1];