ico.js
function(data) {
    var flat_data = [];

    if (typeof data.length === 'undefined') {
      if (typeof data === 'object') {
        for (var key in data) {
          if (data.hasOwnProperty(key))
            flat_data = flat_data.concat(this.flatten(data[key]));
        }
      } else {
        return [];
      }
    }

    for (var i = 0; i < data.length; i++) {
      if (typeof data[i].length === 'number') {
        flat_data = flat_data.concat(this.flatten(data[i]));
      } else {
        flat_data.push(data[i]);
      }
    }
    return flat_data;
  }
function(data) {
    var flat_data = [];

    if (typeof data.length === 'undefined') {
      if (typeof data === 'object') {
        for (var key in data) {
          if (data.hasOwnProperty(key))
            flat_data = flat_data.concat(this.flatten(data[key]));
        }
      } else {
        return [];
      }
    }

    for (var i = 0; i < data.length; i++) {
      if (typeof data[i].length === 'number') {
        flat_data = flat_data.concat(this.flatten(data[i]));
      } else {
        flat_data.push(data[i]);
      }
    }
    return flat_data;
  }
function ( data ) { var flat_data = [ ] ; if ( typeof data . length === 'undefined' ) { if ( typeof data === 'object' ) { for ( var key in data ) { if ( data . hasOwnProperty ( key ) ) flat_data = flat_data . concat ( this . flatten ( data [ key ] ) ) ; } } else { return [ ] ; } } for ( var i = 0 ; i < data . length ; i ++ ) { if ( typeof data [ i ] . length === 'number' ) { flat_data = flat_data . concat ( this . flatten ( data [ i ] ) ) ; } else { flat_data . push ( data [ i ] ) ; } } return flat_data ; }
Flattens objects into an array.

@param {Object} data Values to flatten
@returns {Array} Flattened values
Flattens objects into an array .