console.log("Hello world!");
class Memo {
constructor() {
this.k = {};
this.o = null;
}
N(params, size) {
if (this.o !== params){delete this.k[this.o];}
this.o = params;
this.k[params] = new Array(size).fill(null);
}
C(params,P) {
if (this.o !== params){delete this.k[this.o];}
var g = 0;
this.o = params;
while (this.k[g] !== null){g++;}
this.k[params][g]=P;
}
G(params){
if (this.o !== params){delete this.k[this.o];}
var g = 0;
this.o = params;
while (this.k[g] !== null){g++;}
return this.k[params][g-1];
}
}
const obj = new Memo();
obj.N("data", 100);
To embed this project on your website, copy the following code and paste it into your website's HTML: