News for hackers. Stuff that matters.
Re:JavaScript for People Who Hate JavaScript by wwwigham on Wednesday August 09, 2017 @12:41PM (#14971008)
> Kotlin's Any is pretty much the opposite of TypeScript's any. In TS it disables type checking completely (according to the docs). In Kotlin it's the top type (similar to Java's Object type), which anything conforms with, but doesn't expose any operations at all (except for the stuff that the JVM provides for free).

If you want top-type like behavior in TS, you want to use `{}` instead of any, since the language is structural. Anything satisfies it, but it exposes no members without a cast or guard to a more specific type.

There are no comments on this comment yet.