0 points

javascript - How to watch for array changes? - Stack Overflow


dashboard

Fri Aug 21 2020 13:41:32 GMT+0000 (UTC)

Posted by @rdemo #javascript

function processQ() {
   // ... this will be called on each .push
}

var myEventsQ = [];
myEventsQ.push = function() { Array.prototype.push.apply(this, arguments);  processQ();};
content_copy Copy

https://stackoverflow.com/questions/5100376/how-to-watch-for-array-changes