Is it possible to create an empty multidimensional array in javascript/jquery?

后端 未结 8 2229
粉色の甜心
粉色の甜心 2020-12-06 10:36

I am trying to create a very basic Flickr gallery using the Flickr API. What I want to achieve is sorting my pictures by tag. What I am using is jQuery.getJSON() so that I c

8条回答
  •  广开言路
    2020-12-06 11:34

    Maybe something like that in your each:

    if ( imageArray[item.tags] != null ){
       imageArray[item.tags][imageArray[item.tags].length] = item.url_sq;
    }else{
       imageArray[item.tags] = [];
    }
    

提交回复
热议问题