I'd like to declare a number on a class as optional, using the '?' operator.
export class DummyClass {
dummyId?: number;
}
Visual Studio doesn't let me compile because of a '; is expected. Unexpected token' error. However when I e.g. declare a function or interface, it works without problems:
void(sup?: number) {} // nothing to complain here
Are there some rules about this? Or is something wrong with Intellisense?