-1

Angularjs specific code:

var deferred = $q.defer(),
    nextTransClass, prevTransClass;

What's the meaning of this? I have never seen such variable assignment.

Upvote
  • 65,847
  • 122
  • 353
  • 577

1 Answers1

5

They're not all assigned to the same variable; they're just being declared on the same line.

The code above is equivalent o the following:

var deferred = $q.defer();
var nextTransClass;
var prevTransClass;

P.S. There's nothing Angular specific about this (besides for $q.defer(), obviously). This is just standard vanilla JavaScript.

Joseph Silber
  • 193,614
  • 53
  • 339
  • 276