Hacker News new | ask | show | jobs
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.

1 comments

Some of the TS examples also include an external library (lodash) to compare features; not sure if that's an apt comparison.