importezewfrom"ezew";classItem(){id: number;construnctor(id:number){this.id=id;}}constitems:Item[]=[]constitems2:Item[]=[]constitemId=0;functionaddItem(id:number){constitem=newItem(id);items.push(item);items2.push(item);returnitem;}functionremoveItem(id:number){items[id]=undefined;}(()=>{consta=addItem(itemId++)constb=addItem(itemId++)constc=addItem(itemId++)})()ezew.addEventWatcher("RemoveItem",(item:Item)=>{// Remove from itemsitems[item.id]=undefined;// Remove from items2items2[item.id]=undefined;})ezew.dispatchEvenet("RemoveItem",this.items[0]);ezew.dispatchEvenet("RemoveItem",this.items[1]);ezew.dispatchEvenet("RemoveItem",this.items[2]);