Reputation: 1
I have been reading a code written in java script where variables are assigned such values and I am unable to make out what exactly it is. Can anyone please specify ?
Upvotes: 0
Views: 534
Reputation: 129079
var a = [], i, j, len;
defines four variables, a
, i
, j
, and len
, and gives a
an initial value of an empty array.
Upvotes: 6
Reputation:
It's not "any variable", it's an array. You can change that later b/c javascript is not strongly typed. The list of things separated by commas just defines them as existing.
Upvotes: 0