Personally, I'd go to something like haskell or f# though, because of a even better type system IMO.
Altough, for learning it, typescript is probably easier and more applicable in the real world.