$watchCollection() for tracking object changes
In AngularJS, $watchCollection() is used to observe changes in an object or array’s properties. Unlike $watch(), which tracks changes at the reference level, $watchCollection() detects additions, deletions, and updates of….