下記のsplice
でのやり方はいかがでしょうか?
a.splice(10);
function addLimited(array, value, limit) {
array.unshift(value);
array.splice(limit);
}
var array = [];
addLimited(array, 1, 10);
addLimited(array, 2, 10);
addLimited(array, 3, 10);
addLimited(array, 4, 10);
addLimited(array, 5, 10);
addLimited(array, 6, 10);
addLimited(array, 7, 10);
addLimited(array, 8, 10);
addLimited(array, 9, 10);
addLimited(array, 10, 10);
addLimited(array, 11, 10);
console.log(array); // [11, 10, 9, 8, 7, 6, 5, 4, 3, 2]