I would like to define the following in Javascript:
var tileXml = new Array();
var tileTextAttribute = new Array();
var tileImageAttribute = new Array();
var tileNotification = new Array();
As:
var tileXml,tileTextAttribute,tileImageAttribute,tileNotification = new Array();
I should be right. For some reason it fails in the second case, why?
LittleBobbyTables - Au Revoir
33k25 gold badges113 silver badges115 bronze badges
asked Jun 28, 2012 at 9:04
Some Java Guy
5,13620 gold badges79 silver badges111 bronze badges
1 Answer 1
No you cannot do that, instead to this
var tileXml = [],tileTextAttribute = [],tileImageAttribute = [],tileNotification = [];
answered Jun 28, 2012 at 9:09
Nhu Trinh
14.1k6 gold badges66 silver badges88 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js
tileNotificationwill be an array, the other ones will be undefined variables.