Skip to main content
added 5 characters in body
Source Link
gdoron
  • 150.6k
  • 59
  • 302
  • 376

There isn't a "real" reason, just to make the code a little bit more readable.

Just like with:

var myAge = 26; var myAgeNextYear = myAge + 1; 

VS:

var myAgeNextYear = 26 + 1; 

My personal preferencepersonal preference is to keep a reference to the obj only if I'm using it more than once.

There isn't a "real" reason, just to make the code a little bit more readable.

Just like with:

var myAge = 26; var myAgeNextYear = myAge + 1; 

VS:

var myAgeNextYear = 26 + 1; 

My personal preference is to keep a reference to the obj only if I'm using more than once.

There isn't a "real" reason, just to make the code a little bit more readable.

Just like with:

var myAge = 26; var myAgeNextYear = myAge + 1; 

VS:

var myAgeNextYear = 26 + 1; 

My personal preference is to keep a reference to the obj only if I'm using it more than once.

Source Link
gdoron
  • 150.6k
  • 59
  • 302
  • 376

There isn't a "real" reason, just to make the code a little bit more readable.

Just like with:

var myAge = 26; var myAgeNextYear = myAge + 1; 

VS:

var myAgeNextYear = 26 + 1; 

My personal preference is to keep a reference to the obj only if I'm using more than once.