admin管理员组文章数量:1410724
I need to use JSDoc to make sock
, data
variables known
var exec = {
/**
* @param {Number} sock
* @param {String} data
*/
1: (sock, data) => {
console.log("GG");
},
2: (sock, data) => {
},
3: (sock, data) => {
}
};
let's say sock is Number
, and data is String
.
/**
* @param {Number} sock
* @param {String} data
*/
I need to set the JSDoc one time only, for the whole object.
I need to use JSDoc to make sock
, data
variables known
var exec = {
/**
* @param {Number} sock
* @param {String} data
*/
1: (sock, data) => {
console.log("GG");
},
2: (sock, data) => {
},
3: (sock, data) => {
}
};
let's say sock is Number
, and data is String
.
/**
* @param {Number} sock
* @param {String} data
*/
I need to set the JSDoc one time only, for the whole object.
Share Improve this question edited Apr 24, 2021 at 13:52 CorrM asked Apr 9, 2019 at 18:54 CorrMCorrM 5276 silver badges22 bronze badges1 Answer
Reset to default 7/**
* @type {Object.<number, function(Object, Object):void>}
*/
var exec = {
1: (sock, data) => {
console.log("GG");
},
2: (sock, data) => {
},
3: (sock, data) => {
}
};
This defines an object with numbers as keys and functions as values which takes two params of type Object.
The Syntax piles from
Object.<[keyType, valueType]>
and
function(param1Type, param2Type, ...):returnType
本文标签: javascriptJSDoc for Lambda function in objectStack Overflow
版权声明:本文标题:javascript - JSDoc for Lambda function in object - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745009452a2637460.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论