Just for fun, I decided to look at TypeScript.
I have one question (so far); given the following typescript code...
class EP {
id: number;
TY: string;
constructor(id: number, ty: string) {
this.id = id;
this.TY = ty;
}
}
and the following typescript code...
var ep = new EP(1, "Yes");
var x = [ep.id, ep.TY];
JavaScript would see this as valid, however TypeScript is complaining of "Incompatible types in array literal expression". How should I annotate "x" in order to clear this error?
For those who are interested, I need to create the array to pass values to SQLite.
Additionally, what would be the syntax for the same when using this as a parameter to a function call, such as an SQLite insert...
db.transaction.executeSql("...", [ep.id, ep.TY], ...);
Thanks.