What is the “type” reserved word in TypeScript?

It’s used for “type aliases”. For example: type StringOrNumber = string | number; type DictionaryOfStringAndPerson = Dictionary<string, Person>; Reference: (edit: removed outdated link) TypeScript Specification v1.5 (section 3.9, “Type Aliases”, pages 46 & 47) Update: (edit: removed outdated link) Now on section 3.10 of the 1.8 spec. Thanks @RandallFlagg for the updated spec and link … Read more

Reserved keywords in JavaScript

Here is my poem, which includes all of the reserved keywords in JavaScript, and is dedicated to those who remain honest in the moment, and not just try to score: Let this long package float, Goto private class if short. While protected with debugger case, Continue volatile interface. Instanceof super synchronized throw, Extends final export … Read more

What’s the use/meaning of the @ character in variable names in C#?

Straight from the C# Language Specification, Identifiers (C#) : The prefix “@” enables the use of keywords as identifiers, which is useful when interfacing with other programming languages. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, without the prefix. An … Read more

What is the equivalent of Java’s final in C#?

The final keyword has several usages in Java. It corresponds to both the sealed and readonly keywords in C#, depending on the context in which it is used. Classes To prevent subclassing (inheritance from the defined class): Java public final class MyFinalClass {…} C# public sealed class MyFinalClass {…} Methods Prevent overriding of a virtual … Read more