I am trying to declare multiple arrays in a single line. But I am taking this error. (Cannot set property "0" of undefined)
var photos,tags = new Array();
flickrJSON.items.forEach(function(item, index) {
photos[index] = item.media.m;
tags[index] = item.tags;
});
Why I take this error? Can somebody explain? and How can I fix it
var photos,tags = new Array();is the same as writingvar photos; var tags = new Array();. Hence the error (photos isundefined).