Hi Deep,

A variable is set, a function is evaluated. If you user the function it 
actually 'runs' that function on the current set of values, and so 
returning an updated value.

Example: 
 var a= 1;
 a = a +1
 function log() {
   console.log('a',a);
 }
 function inc() {
   a = a + 1;
 }
 log();  --> a, 2
 log();  --> a, 2
 log();  --> a, 2
 inc()
 log();  --> a, 3
 log();  --> a, 3
 log();  --> a, 3

It would not make sense if on every log, a would increment right?

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to