Currently, I am incorporating ES6 classes in typescript using the following code snippet:
class Camera {
constructor(ip) {
this.ip = ip;
}
}
Despite encountering an error message, it appears that the code still compiles successfully. The error states:
The property 'ip' is not recognized on type 'Camera'.
When attempting to define the type as shown below:
this.ip: string = ip;
An additional error surfaces:
Semicolon expected.
What adjustments should be made to the class structure in order to resolve both errors?