0

While going through a new project source code, I immediately noticed something unfamiliar:

function(){
   var data = {},
       init = function(){},
       zend;

   return ..

}

So, what is zend; ?

Salman A
  • 248,760
  • 80
  • 417
  • 510
display_name
  • 81
  • 1
  • 6
  • 2
    It looks like it's just declaring a variable called zend. Note the commas at the end of the previous two lines: this is just a continuation of the var line. – Rup May 02 '19 at 12:28
  • @emix has it correct. Notice the `,` after `init = funciton(){}` it's just a continuation of variable declaration. – Irelia May 02 '19 at 12:30
  • Indent the code properly the the problem disappears. – Salman A May 02 '19 at 12:34

1 Answers1

1

It has no special meaning. In this context, it is just a variable name.

The code is equivalent to:

var data = {};
var init = function(){};
var zend;
Quentin
  • 857,932
  • 118
  • 1,152
  • 1,264