|
|
|
|
|
by realharo
3322 days ago
|
|
name: string;
constructor(name: string) {
this.name = name
}
You don't have to do this in TypeScript either, you can just do constructor(public name: string) { }
Also, the "Empty collections" section doesn't do the same thing, the collections you created in Kotlin are immutable.And the TypeScript ones have the value `undefined` (unfortunate that strictNullChecks doesn't catch things like that https://github.com/Microsoft/TypeScript/issues/8476). And for some nitpicking, please be consistent with your semicolons, either use them or don't use them, but don't mix it randomly like that. |
|