Wen you write Test2.prototype = new Test(), you create a single instance Testwith a single instance of the array that is shared by each instance Test2.
Therefore, all instances Test2use the same array.
, base Test Test2, Test2.
:
function Test2() {
Test.call(this);
}