简体   繁体   English

对正在通过 function 的 object 使用 @param

[英]Using @param for an object that is being passed through a function

Basically, what I need to do is use @param for an object that is being passed through to a function.基本上,我需要做的是将@param 用于正在传递给 function 的 object。

/** @param {String} b */
function Hello(a, { b, c }) {


}

I thought it would work something like this, but it doesn't.我认为它会像这样工作,但事实并非如此。

How would I use @param on b, and c?我将如何在 b 和 c 上使用 @param?

So I've figured it out!所以我想通了!

/**
 * @param {object} param0
 * @param {Number} param0.a
*/

async function hello({ a }) {

}

https://jsdoc.app/tags-param.html https://jsdoc.app/tags-param.html

You can read the documentation here as well!您也可以在此处阅读文档!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何基于通过函数传递的参数更改Jquery选择器 - How to change Jquery selector based on an param passed through a function ID未通过函数调用JavaScript传递 - Id not being passed through function call JavaScript 如果 function 作为“目标”参数传递,Object.assign output 是否不同 - Does Object.assign output differ if a function is passed as the 'target' param 对象在传递给另一个函数后发生了变化 - object changed after being passed to another function 护照 object 传入 function 后未定义 - passport object undefined after being passed into function POSTDATA没有使用javascript submit()函数传递 - POSTDATA not being passed using javascript submit() function 为什么要迭代的对象通过回调传递回去? - Why is the object being iterated passed back through the callback? JavaScript - 使用apply来调用函数,但是'this'没有被设置为作为第一个参数传递的对象 - JavaScript - using apply to invoke function, but 'this' is not being set to the object passed as first argument 使用在js函数上接收到的整数作为参数来获取与传递的整数作为参数具有相同ID的div ID - using integer received on js function as param to fetch div id with same id as passed integer as param JavaScript保留关键字未正确通过函数传递 - JavaScript reserved keywords not correctly being passed through function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM