This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArrayDs { | |
length: number; | |
data: {}; | |
constructor(...args: any) { | |
this.length = args.length;// Initialize the length of the array to track its size. | |
this.data = {};// Initialize the data object to store the items. | |
for (let i = 0; i < args.length; i++) {// fill the data object with the given items. | |
this.data[i] = args[i]; | |
} | |
} |