This project is read-only.

Improve 'typeof'

Topics: Language Specification
Jul 29, 2014 at 8:45 AM
When creating classes in Typescript, you kind of expect that these classes (types) can be detected by 'typeof'

Class MyDate {  }
var d = new MyDate()
console.log ( typeof( d ) ); 
result = 'object'
expected result = 'MyDate'

I know this is a 'limitation' of Javascript - but shouldn't it be possible to inject this functionality ??

a possible solution for my problem can be read here:

I guess i just need to use that way instead ?