我有一个接受对象数组的函数。
看起来像这样。
myAwesomeFunction([
{
name: 'someName',
next: false,
test: 'test'
},
{
name: 'nameTwo',
next: true
}
]);
到目前为止,我的 JSDoc 看起来像这样
/**
* My description
* @param {Array.<Object>}
*/
但是我如何描述对象的属性、类型和描述,以及它们是否是对象的可选内容?
谢谢。
最佳答案
/**
* Assign the project to a list of employees.
* @param {Object[]} employees - The employees who are responsible for the project.
* @param {string} employees[].name - The name of an employee.
* @param {string} employees[].department - The employee's department.
*/
Project.prototype.assign = function(employees) {
// ...
};
/**
关于javascript - 在 JSDoc 中描述对象数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39942884/