// This example is from the book JavaScript: The Definitive Guide. // Written by Dog. // This example is provided WITHOUT WARRANTY either expressed or implied. // You may study, use, modify, and distribute it for any purpose. // The constructor function function EmptyArray(length) { this.size = length; for(var i = 1; i <= length; i++) this[i] = 0; } // Using the constructor a = new EmptyArray(32);