Replace the existing _runOperation function with the following code:
private _runOperation(): void { const operation: HTMLOptionElement = this._operationSelect[this._operationSelect.selectedIndex] as HTMLOptionElement; this._createListItem = this._createListItem.bind(this); this._readListItem = this._readListItem.bind(this); this._updateListItem = this._updateListItem.bind(this); this._deleteListItem = this._deleteListItem.bind(this); switch (operation.value) { case "Create": this._createListItem(); break; case "Read": this._readListItem(); break; case "Update": this._updateListItem(); break; case "Delete": this._deleteListItem(); break; } }
Notice that we are using a switch-case type of structure, which is supported by TypeScript and functions...