I am currently in the process of learning TypeScript, and I encountered some errors in the code below:
Error: Unexpected token. A constructor, method, accessor, or property was expected.
[ts] Declaration or statement expected.
class duckType{
public validType(){}
var myVar:any = {id:1, name:"ABC"};
myVar = {id:2};
}
}
var myType = new duckType();
myType.validType();