What's wrong with this JavaScript cache data?

What's wrong with this JavaScript cache data in a response handler. The JavaScript code caches a mutable array and returns it directly, so callers mutate shared state. In JavaScript services this causes ghost data.

#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascrip...

https://www.youtube.com/watch?v=kYEdUmbJb2Y

Whats wrong with this JavaScript cache data? #javascriptbackend

YouTube