docs: function object2array(obj, key) {
      if (typeof obj != "object") {
          return false;
      }
      if (key && typeof key != "string") {
          return false;
      }
  
      var arr = [];
      var index;
      if (key) {
          for (index in obj) {
              if (obj.hasOwnProperty(index)) {
                  obj[index][key] = index;
                  arr.push(obj[index]);
              }
          }
      } else {
          for (index in obj) {
              if (obj.hasOwnProperty(index)) {
                  arr.push(obj[index]);
              }
          }
      }
  
      return arr;
  }