48
votes
14answers
4k views

Returning different types from one function in a dynamically typed language

I come from a statically typed language background (Java). In Java, you have to return a single type from every method. For example, you can't have a method that conditionally returns a String or ...
7
votes
13answers
3k views

Would a statically typed alternative to JavaScript on webpages be practical?

Preference for dynamic and static typing is largely a matter of taste, and different people find them more or less suitable in different situations. My question is, would it be technically possible ...