(2 years later...) If you're truly looking to truncate an array, you can also use the length
attribute:
var stooges = ["Moe", "Larry", "Shemp", "Curly", "Joe"];
stooges.length = 3; // now stooges is ["Moe", "Larry", "Shemp"]
Note: if you assign a length which is longer than current length, undefined array elements are introduced, as shown below.
var stooges = ["Moe", "Larry", "Shemp"];
stooges.length = 5;
alert(typeof stooges[4]); // alerts "undefined"
EDIT:
As @twhitehead mentioned below, the addition of undefined elements can be avoided by doing this:
var stooges = ["Moe", "Larry", "Shemp"];
stooges.length = Math.min(stooges.length, 5);
alert(stooges.length)// alerts "3"