gpt4 book ai didi

javascript - 如何在 jsdoc 函数参数中指定 Date 对象?

转载 作者:行者123 更新时间:2023-12-03 23:45:16 25 4
gpt4 key购买 nike

/**
*
* @param {?} date
*/
function diffDays (date){

var utcThis = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds(), this.getMilliseconds());
var utcOther = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());

return (utcThis - utcOther) / 86400000;
};
我在 jsdoc 文档中找不到任何关于内置 Date 对象的文档。在参数列表中指定日期类型的推荐方法是什么。

最佳答案

我是这样写的

/**
* @param {Date} date - input date
*/

关于javascript - 如何在 jsdoc 函数参数中指定 Date 对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63198861/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com