javascript: new arrays from keywords

jersmi's picture

The following javascript outputs a structure of urls from a directory scanner. What would be a good way to do a keyword search and generate new arrays of urls sorted by keywords? I'm a little lost -- could i use the javascript filter method?

_urls = []
function (__structure list) main (__structure gifs)
   var result = new Object()
   if (gifs != null) {   
      u = 0;
      for (var i=0; i < gifs.length; ++i) {
         _urls[u++] = gifs[i][1];
   result.list = _urls;
   return result