如何在javascript文档中指定返回的对象格式

时间:2018-07-09 16:23:13

标签: javascript documentation

我编写了一个javascript函数,用于处理数据并返回具有特定格式的对象。

function processData(itemToProcess){

    var information = itemToProcess.extractInformation();
    var returnedInfo = {
        "firstAttribute": information[0],
        "secondAttribute": information[1]
    };

    return returnedInfo;

}

我想为@returns字段指定返回对象的格式,但是我不知道是否有适当的方法来执行此操作,或者我是否仅需要自行设置其格式,例如:

@returns : an object with the information formatted as:
    - firstAttribute: this attribute is the most important
    - secondAttribute: this attribute is the second most important

是否有一种特定的,正确的方法来用Javascript记录返回的对象,或者是编码员的选择?

谢谢您的帮助。

0 个答案:

没有答案