logoalt Hacker News

monster_truck • today at 9:20 AM • 2 replies • view on HN

It's had return type declarations since 7. There's even intersection and literal types now. You could have typed this into google and it would have told you


Replies

origini • today at 10:43 AM

I did and it told me that it doesn't support typed arrays.

bakugo • today at 10:33 AM

Type declarations are still quite limited, though. For example, you can declare that a function returns an array or a string, but not an array of strings.

➕ show 1 reply