Some of those features are only possible because Java is statically typed. They couldnt exist in the same way for "pure" JavaScript.
Why not just use a different language altogether? One that was designed with static type checking from the ground up?
Maybe Facebook likes the pain, they also pushed PHP further than anyone else was willing to. Burning insane amounts of resources with a somewhat disappointing result.