// Make an array...
months = new Array("January", "Friday", "April", "May", "Sunday", "Monday", "July");
// Hmmm. Something's wrong with our array. Let's fix it up.
// First, let's get rid of "Friday"
months.splice(1,1);
// months is now:
// ["January", "April", "May", "Sunday", "Monday", "July"]
// Now, let's add the two months before "April".
// Note that we won't delete anything here (deleteCount is 0).
months.splice(1, 0, "February", "March");
// months is now:
// ["January", "February", "March", "April", "May", "Sunday", "Monday", "July"]
// Finally, let's remove "Sunday" and "Monday" while inserting "June"
months.splice(5, 2, "june");
// months is now:
// ["January", "February", "March", "April", "May", "June", "July"]
// Now that our months array is fixed, let's trim it
// so that it contains only the first quarter of the year
// by deleting all elements starting with index 3 (i.e., "April")
months.splice(3); // months is now: ["January", "February", "March"]