Javacript Array issue - why do I get undefined when trying to get the upper bound?
<p>I was just thinking back to the good old days when I used to use VBScript (good old days?!?!? What am I thinking?), and I remember using two very useful methods with arrays, these were UBound and LBound. Now I don't think JavaScript has these and if I wanted to make my own I could extend the object however, I just tried doing this to return the upperbound item (or the last item of the array)</p>

<pre><code>var myArray = ['1','2','3','4','5','6','seven', 8, 'nine','10'];
document.write(myArray.length + ' ' + myArray[myArray.length]);
</code></pre>

<p>the <code>myArray.length</code> returns what it should however when I try and output the last item using <code>myArray[myArray.length]</code> I get <code>undefined</code>? Anyone know why this is?</p>

<p>Thanks</p>
