Err.. Gmail.
You're grossly underestimating JavaScript.
With JavaScript its possible to break your code into logical abstractions, either functional or object oriented or a hybrid of the two.
What's stops you from writing maintainable JavaScript apps is perhaps the quality of devs.