Kinda really. This entire class of security lapse can be avoided by not building a js app on the client.
This sort of thing happens all the time to all sorts of services. Rather than just blaming JS, it's far more productive to think of technical controls that could catch this. For example Taint Checking[3] or scanning server responses for API keys.
[1]: https://news.ycombinator.com/item?id=31026374