How to use $watchgroup or $watchCollection on 2 variable out of which one is array?
<p>If we have 2 variable then we can use $watchCollection or $watchgroup as shown below.</p>

<pre><code>$scope.firstPlanet = 'Earth';
$scope.secondPlanet = 'Mars';

$scope.$watchCollection('[firstPlanet, secondPlanet]', function(newValues){
  console.log('*** Watched has been fired. ***');
  console.log('New Planets :', newValues[0], newValues[1]);
});
</code></pre>

<p>How can we use $watchCollection if</p>

<pre><code>$scope.myPlanet = 'Earth';  
$scope.otherPlanet = ['Venus','Jupiter','Mars'];
</code></pre>

<p>and how to access the each variable value.</p>