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

They added static typing to javascript, except you can still pass a number to a function that takes a string. In their example http://www.typescriptlang.org/Playground/ replace the

   new Greeter("World");
with

   new Greeter(5);
and it still works. What good is adding types to functions if they are ignored?


TypeScript will not abort compilation, but it will give you a warning. In the playground, that would be the red squiggly line indicating an error.


In the "Walkthrough: Types" example (as well as the "Classes" one), that gives me an error.




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

Search: