I encountered an error that I'm having trouble fixing. Can someone assist me with it?
Uncaught TypeError: Cannot set property 'version' of undefined at API.version (:5:30) at :11:8
class API {
private message: {
version: string,
success: boolean
};
public version() {
this.message.version = "1.0";
console.log(this.message);
}
}
let apiObj = new API();
apiObj.version();