-1

Angularjs specific code:

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

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

UpCat
  • 67,448
  • 127
  • 369
  • 590

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
  • 205,539
  • 55
  • 352
  • 286