Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Types are allowed to be any of the primitive types (e.g. Boolean, Number, etc.), null, undefined, any custom "class", a specifically-typed array (e.g. [Number] for an array of numbers), or a specifically-typed object (e.g. {x: Number, y: String}). I do plan on being able to alias the typed object as an "interface", just haven't gotten around to that.

A failure of type checking generally means you get an early runtime error, though I plan on reworking things to catch more at compile-time (while still not being a pain).



How do types work with objects and classes? Can you subtype?


Yeah, class Child extends Parent




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: