function arrayToJSON(array, toJSONOptions) {
    if (!(array && array.length))
        return undefined;
    var obj = {};
    for (var i = 0; i < array.length; ++i)
        obj[array[i].name] = array[i].toJSON(toJSONOptions);
    return obj;
}
Converts an array of reflection objects to JSON.
@memberof Namespace
@param {ReflectionObject[]} array Object array
@param {IToJSONOptions} [toJSONOptions] JSON conversion options
@returns {Object.<string,*>|undefined} JSON object or `undefined` when array is empty