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
  • 262,204
  • 82
  • 430
  • 521
display_name
  • 91
  • 1
  • 1
  • 7
  • 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
  • 914,110
  • 126
  • 1,211
  • 1,335